Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed1a.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.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'inherited': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; '*never*': 0.16; '>on': 0.16; 'adjacent': 0.16; 'bend': 0.16; 'message- id:@4ax.com': 0.16; 'multitude': 0.16; 'opposite': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:Classes': 0.16; 'thread,': 0.16; 'width,': 0.16; 'width.': 0.16; 'wrote:': 0.18; 'trying': 0.19; 'differ': 0.19; '>>>': 0.22; '+0000': 0.22; 'imposed': 0.24; 'url:home': 0.24; '(or': 0.24; 'question': 0.24; 'mention': 0.26; 'header:X -Complaints-To:1': 0.27; 'tim': 0.29; "i'm": 0.30; 'option.': 0.31; 'class': 0.32; 'probably': 0.32; 'addresses': 0.33; "i'd": 0.34; 'equal': 0.35; 'late': 0.35; 'but': 0.35; 'skip:> 10': 0.36; 'whilst': 0.36; 'charset:us-ascii': 0.36; 'should': 0.36; 'two': 0.37; 'nov': 0.38; 'to:addr:python-list': 0.38; 'issue': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'length': 0.61; 'circle': 0.68; 'useful.': 0.68; 'square': 0.74; 'other.': 0.75; 'partially': 0.84; 'square,': 0.84; 'received:108': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dennis Lee Bieber Subject: Re: Classes Date: Sun, 02 Nov 2014 11:31:12 -0500 Organization: IISS Elusive Unicorn References: <20141031104319.02e1ca6f@rg.highlandtechnology.com> <2i585a5s6d1aagbh6ot2b88i51o8jhq0db@4ax.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: adsl-108-79-216-126.dsl.klmzmi.sbcglobal.net X-Newsreader: Forte Agent 6.00/32.1186 X-No-Archive: YES 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: 34 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1414945885 news.xs4all.nl 2830 [2001:888:2000:d::a6]:46465 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:80125 On Sun, 2 Nov 2014 12:27:06 +0000 (UTC), Denis McMahon declaimed the following: >On Sun, 02 Nov 2014 21:32:13 +1100, Tim Delaney wrote: > >> On 2 November 2014 20:50, Denis McMahon >> wrote: >> >>> The question (I thought) was to write a class for Square that inherited >>> a class Rectangle but imposed on it the additional constraints of a >>> square over a rectangle, namely that length == width. >>> >>> >> I'm late to the party and this has already been partially addressed in >> the thread, but it always annoys me. A square is as much a rhombus with >> 90 degree angles as it is a rectangle with equal length and width, and >> yet I *never* see the former given as an option. >> >> If course, that's probably because rectangles have a multitude of uses >> for user interfaces, whilst other quadrilaterals are somewhat less >> useful. > >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. I'd class them as parallelograms -- as they differ from a trapezoid in that opposite faces are parallel... Not to mention "arrow heads" where two adjacent sides actually bend inwards. -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/