Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed5.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.007 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'classes.': 0.05; 'subject:Python': 0.06; 'dictionary': 0.07; 'inclined': 0.09; 'kelly': 0.09; 'am,': 0.14; 'wrote:': 0.14; 'angelico': 0.16; "else's": 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'non-trivial': 0.16; 'so...': 0.16; 'subject:() ': 0.16; 'subject:considered': 0.16; 'header:In-Reply-To:1': 0.21; 'seems': 0.21; 'received:209.85.210.174': 0.23; 'received:mail- iy0-f174.google.com': 0.23; 'classes': 0.26; 'example': 0.27; 'message-id:@mail.gmail.com': 0.28; 'manually': 0.29; 'sat,': 0.29; 'code,': 0.29; 'implement': 0.30; "won't": 0.30; 'anyone': 0.32; 'someone': 0.33; 'to:addr:python-list': 0.33; 'things': 0.33; "i've": 0.33; 'chris': 0.34; 'there': 0.35; 'not,': 0.35; 'certain': 0.36; 'received:google.com': 0.37; 'useful': 0.37; 'received:209.85': 0.37; 'case': 0.37; 'tool': 0.38; 'but': 0.38; 'authors': 0.38; 'subject:: ': 0.38; 'received:209': 0.39; 'to:addr:python.org': 0.39; 'subject:!': 0.67; 'offer': 0.71; 'risk': 0.75; 'cooperation': 0.84; 'break.': 0.84; 'everything,': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=wlMTFbPLZlohWizy9fgAAnmTHJC4q4Nn1Y/9sO9dTLY=; b=qWQnHOFkQEDqOr6tL2l/ih7XXxRa/WQhCfUmHLHLrtq63p1D3PJbLan6myHhPMvU6M h/tAZO40S7KTkW9y+Y/xfgQTll5aXW7he2QKlzUI+8xHgcbaXPWJKB3O5lLzE7vhwvs1 cp1dM7DRXAIvtk9x4rRoXLSevHtz5vrMhPf7Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=CIdsbVBqtRswnCOfZHNR9/VycnttKiEFd4xNUWg8io1Ph21rFLlTpc2gvFP7WiUYRD fAbe/A3/ONhHU//Bkb7qL40Ep6ZosjIxlbpEm5414U5sRnzCVGZAI5liEIaU4BHFJvWR QlsEjN+szuyrtWLYBK7BX3XayF1d4LMp5BZvc= MIME-Version: 1.0 In-Reply-To: References: <1f0d88bd-e2e6-4780-9d9e-784fb3f53837@k3g2000prl.googlegroups.com> Date: Sat, 28 May 2011 04:46:12 +1000 Subject: Re: Python's super() considered super! From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 16 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1306521975 news.xs4all.nl 49175 [::ffff:82.94.164.166]:36046 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:6426 On Sat, May 28, 2011 at 4:31 AM, Ian Kelly wrote: > It seems to me that the example of combining built-in dictionary > classes is naively optimistic. So... Can anyone offer a non-trivial example of multiple inheritance that *doesn't* have pitfalls? From what I've seen, MI always seems to require cooperation from the authors of all involved classes. It may be a useful tool when you control everything, but whenever you use someone else's code, there seems to be this massive barrier of risk (if that makes sense). For the DefaultOrderedCounter, I would be strongly inclined to inherit singly, and then manually implement the other half (whichever half is easier); in this case that happens to be trivial (override __missing__), but even were it not, it would be a means of being certain that things won't break. Chris Angelico