Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!bcyclone05.am1.xlned.com!bcyclone05.am1.xlned.com!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.143 X-Spam-Level: * X-Spam-Evidence: '*H*': 0.72; '*S*': 0.00; 'methods,': 0.09; 'mutated': 0.16; 'subject:Classes': 0.16; 'wrote:': 0.18; 'trying': 0.19; 'restrictions': 0.19; 'email addr:gmail.com>': 0.22; '(or': 0.24; '>': 0.26; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; "doesn't": 0.30; 'message-id:@mail.gmail.com': 0.30; 'class': 0.32; 'addresses': 0.33; 'problem': 0.35; 'no,': 0.35; 'received:google.com': 0.35; 'should': 0.36; 'nov': 0.38; 'to:addr :python-list': 0.38; 'issue': 0.38; 'rather': 0.38; 'to:addr:python.org': 0.39; 'matter': 0.61; "you're": 0.61; 'circle': 0.68; 'square': 0.74; 'other.': 0.75; 'partially': 0.84; 'square,': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=HLljHwHDBHUDCklWblUntUdISoTDqFzQzonNN1o1EAc=; b=D/uTYFpSuNNUbdqwsMqjz/n8nYCwM/6QQMOQW4Yh3kIuvd/ZOqy4QYr+az52ed1PgY QRlZ2/MvMsnUtZl3+SUz8/ejohQJaP3TvtMhuCR9tfJ29rMaNQe8Vz2FZldh01Yb4Te7 6CpNvrRqNevneHpAATCFX0VLYEYFTp9tg2YSYySnMVedVIGxY30pBKBFIutf/dlgctqE SouR5u0uTW9pew1V4HgSjX+9c13i/f/GuooOd507m8ysMuH1wQ3AOtVc4ByEsZhZ72RV BmaSX2MBqx2rFZ3GRYQILfU1gp+r8xGdJQCx3d6Ebri1lLYo3qxEyoHb+xopwp121I7q ruig== MIME-Version: 1.0 X-Received: by 10.66.191.135 with SMTP id gy7mr43404074pac.95.1415026068003; Mon, 03 Nov 2014 06:47:48 -0800 (PST) In-Reply-To: References: <5453c1a6$0$12981$c3e8da3$5496439d@news.astraweb.com> <7pg75alj1qn97hlirk81f7nqd265emgu05@4ax.com> <20141031104319.02e1ca6f@rg.highlandtechnology.com> <2i585a5s6d1aagbh6ot2b88i51o8jhq0db@4ax.com> Date: Mon, 3 Nov 2014 07:47:47 -0700 Subject: Re: Classes From: Ian Kelly To: Python Content-Type: multipart/alternative; boundary=047d7bdc7b1a21a6540506f56eb1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 33 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1415026077 news.xs4all.nl 2924 [2001:888:2000:d::a6]:58144 X-Complaints-To: abuse@xs4all.nl X-Received-Bytes: 5174 X-Received-Body-CRC: 809358877 Xref: csiph.com comp.lang.python:80157 --047d7bdc7b1a21a6540506f56eb1 Content-Type: text/plain; charset=UTF-8 On Nov 2, 2014 5:31 AM, "Denis McMahon" wrote: > And perhaps that also addresses the square - rectangle (or circle - > ellipse) issue - square, rectangle and rhombus are all forms of > quadrilateral, and perhaps should all inherit a base class Quadrilateral, > rather than trying (and partially failing) to inherit each other. No, it doesn't matter whether you have square inheriting from rectangle, rhombus or quadrilateral. If the base class has mutator methods, you're still going to have this problem when they allow the object to be mutated in ways that violate the restrictions of the subclass. --047d7bdc7b1a21a6540506f56eb1 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


On Nov 2, 2014 5:31 AM, "Denis McMahon" <denismfmcmahon@gmail.com> wrote:
> And perhaps that also addresses the square - rectangle (or circle - > ellipse) issue - square, rectangle and rhombus are all forms of
> quadrilateral, and perhaps should all inherit a base class Quadrilater= al,
> rather than trying (and partially failing) to inherit each other.

No, it doesn't matter whether you have square inheriting= from rectangle, rhombus or quadrilateral. If the base class has mutator me= thods, you're still going to have this problem when they allow the obje= ct to be mutated in ways that violate the restrictions of the subclass.

--047d7bdc7b1a21a6540506f56eb1--