Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Ben Finney Newsgroups: comp.lang.python Subject: Re: Multiple inheritance, super() and changing signature Date: Sat, 04 Jun 2016 06:19:15 +1000 Lines: 24 Message-ID: References: <80ea0ea1-5468-2dee-2c38-c2b09801d0f1@shopzeus.com> <574e45f4$0$1611$c3e8da3$5496439d@news.astraweb.com> <36545ac2-0aab-3ee6-fb60-c539c9c7c95a@shopzeus.com> <85bn3i58l8.fsf@benfinney.id.au> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: news.uni-berlin.de WQnULjO7jxeKxd9Coc0CSg9YDZWl2JKFomWDpeXFHa0g== Cancel-Lock: sha1:umGVUVjSzdV7nFvpEmrzKRDSD7Q= Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.048 X-Spam-Evidence: '*H*': 0.91; '*S*': 0.00; 'classes,': 0.05; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'substitution': 0.09; 'worked.': 0.09; ':-)': 0.12; 'received:80.91.229.3': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'subject:changing': 0.16; 'substituting': 0.16; 'stick': 0.18; 'meant': 0.22; 'parameter': 0.22; 'header :User-Agent:1': 0.26; 'header:X-Complaints-To:1': 0.26; 'obliged': 0.29; "i'm": 0.30; 'classes': 0.30; 'that.': 0.30; 'help!': 0.30; 'class': 0.33; 'problem': 0.33; 'common': 0.33; 'instances': 0.33; 'case,': 0.34; 'but': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'received:org': 0.37; 'things': 0.38; 'doing': 0.38; 'thank': 0.38; 'why': 0.39; 'to:addr:python.org': 0.40; 'your': 0.60; 'different': 0.63; 'difficulty': 0.66; 'design.': 0.72; 'truth': 0.79; 'discovered': 0.83; '_o__)': 0.84; 'fortunately,': 0.84; 'good:': 0.84; 'nagy': 0.84; 'received:125': 0.84; 'solved.': 0.84; 'glad': 0.87; 'cooperative': 0.93 X-Injected-Via-Gmane: http://gmane.org/ X-Gmane-NNTP-Posting-Host: jigong.madmonks.org X-Public-Key-ID: 0xAC128405 X-Public-Key-Fingerprint: 517C F14B B2F3 98B0 CB35 4855 B8B2 4C06 AC12 8405 X-Public-Key-URL: http://www.benfinney.id.au/contact/bfinney-pubkey.asc X-Post-From: Ben Finney User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: <85bn3i58l8.fsf@benfinney.id.au> X-Mailman-Original-References: <80ea0ea1-5468-2dee-2c38-c2b09801d0f1@shopzeus.com> <574e45f4$0$1611$c3e8da3$5496439d@news.astraweb.com> <36545ac2-0aab-3ee6-fb60-c539c9c7c95a@shopzeus.com> Xref: csiph.com comp.lang.python:109438 Nagy László Zsolt writes: > Fortunately, I can change all of the classes, and extracting the > common parameter into a common base class worked. This is why Liskov's Substitution Principle is good: Thinking of it as a law helps lead to better design. In this case, the same parameter doing different things in different sub-classes meant that instances of those sub-classes had difficulty substituting for the superclass. Interrogating the design against the LSP reveals that. > Problem solved. Thank you for all your help! > Cooperative classes are fantastic! :-) I'm glad you discovered them :-) -- \ “Truth is stranger than fiction, but it is because fiction is | `\ obliged to stick to possibilities, truth isn't.” —Mark Twain, | _o__) _Following the Equator_ | Ben Finney