Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeder2.ecngs.de!ecngs!feeder.ecngs.de!xlned.com!feeder1.xlned.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!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.017 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'see.': 0.07; 'sep': 0.09; 'subclasses': 0.09; 'yet.': 0.13; 'sat,': 0.15; 'a(object):': 0.16; 'b):': 0.16; 'classes:': 0.16; 'inheritance': 0.16; 'mro': 0.16; 'worse.': 0.16; 'wrote:': 0.17; 'saying': 0.18; 'class.': 0.23; 'somebody': 0.23; 'pass': 0.25; 'header:In-Reply-To:1': 0.25; 'change,': 0.27; 'message-id:@mail.gmail.com': 0.27; 'actual': 0.28; "d'aprano": 0.29; 'parent': 0.29; 'steven': 0.29; 'van': 0.29; 'class': 0.29; 'classes': 0.30; 'structure': 0.32; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'pm,': 0.35; 'subject:?': 0.35; 'received:209.85': 0.35; 'next': 0.35; 'but': 0.36; 'depends': 0.36; 'quite': 0.37; 'received:209': 0.37; 'far': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'your': 0.60; 'different': 0.63; 'sounds': 0.71; 'subject:always': 0.84; 'to:name:python': 0.84; 'subject:add': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=ZTd2pM0xD69y8EMhdgTV8rXcnXfAIJHGzQ9EfpszxEI=; b=a5tm2G/djTRyVGt/qoBHb//iqfxHYdVwvwgdL+1YRe8qqNKF1nIefAR72v7MY9GiMj 6bt94AMrpubOMO/HHC6aB4t7MACtRHojH/fjQMXYTyrUsJWVhxLmd0nipcaR2trzEobR 4nvKrObnDN19jpAVkEbWTAaLDyaKslY3MDYavM/tGBCkkmBDtIWv0OG4NZJZINHsKoFp BngBfU32aQsgxg6USrlAuyvKB4lQd51Q/cVM/PxSNgdPf7yrq7Q285RVsi4GR535Zr7S t9p831tP+iQkeZUvbGDk+Nh7mYmb+vQMEWRJmr1KpVkzyk2LXv30nBaH0FK8EGfRapOc 3o2w== MIME-Version: 1.0 In-Reply-To: <5067cd36$0$29981$c3e8da3$5496439d@news.astraweb.com> References: <50672d20$0$29981$c3e8da3$5496439d@news.astraweb.com> <5067cd36$0$29981$c3e8da3$5496439d@news.astraweb.com> From: Ian Kelly Date: Sun, 30 Sep 2012 00:08:03 -0600 Subject: Re: Should one always add super().__init__() to the __init__? To: Python Content-Type: text/plain; charset=ISO-8859-1 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: 24 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1348985321 news.xs4all.nl 6978 [2001:888:2000:d::a6]:46069 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:30543 On Sat, Sep 29, 2012 at 10:40 PM, Steven D'Aprano wrote: > On Sat, 29 Sep 2012 17:51:29 -0400, Piet van Oostrum wrote: > >> It is not necesarily calling the parent class. It calls the initializer >> of the next class in the MRO order and what class that is depends on the >> actual multiple inheritance structure it is used in, which can depend on >> subclasses that you don't know yet. This makes it even worse. > > I don't quite follow you here. It sounds like you are saying that if you > have these classes: > > # pre-existing classes > class A(object): pass > class B(object): pass > > # your class > class C(A, B): pass > > and somebody subclasses A or B, the MRO of C will change. That is not > actually the case as far as I can see. The MRO of C will not change, but the class that follows C may be different in the MRO of a subclass.