Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Ian Kelly Newsgroups: comp.lang.python Subject: Re: Multiple inheritance, super() and changing signature Date: Thu, 2 Jun 2016 11:55:16 -0600 Lines: 29 Message-ID: References: <80ea0ea1-5468-2dee-2c38-c2b09801d0f1@shopzeus.com> <85h9de6lp4.fsf@benfinney.id.au> <52defc17-a6e6-4f7e-a91d-4e1e3b263b55@googlegroups.com> <57506e90$0$1602$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: news.uni-berlin.de 5JWSt7NqfaGmBBePuy2Y9ABNIXlRDU0jjNErCKrGaMxg== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'method.': 0.05; 'url:msdn': 0.07; 'wednesday,': 0.07; 'cc:addr:python-list': 0.09; '*is*': 0.09; '__init__': 0.09; 'received:209.85.218': 0.10; 'python': 0.10; 'language,': 0.11; 'thu,': 0.15; '2016': 0.16; 'cc:name:python': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'statement.': 0.16; 'subject:changing': 0.16; 'sugar': 0.16; 'syntactic': 0.16; 'wrote:': 0.16; 'instance,': 0.18; '>>>': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'not,': 0.22; 'lawrence': 0.22; 'am,': 0.23; 'properties': 0.24; 'header:In- Reply-To:1': 0.24; 'example': 0.26; 'equivalent': 0.27; 'message- id:@mail.gmail.com': 0.27; '(although': 0.29; 'python).': 0.29; 'array': 0.29; 'creating': 0.30; 'language.': 0.32; 'class': 0.33; "d'aprano": 0.33; 'int': 0.33; 'steven': 0.33; 'similar': 0.33; 'received:google.com': 0.35; 'instance': 0.35; 'quite': 0.35; 'but': 0.36; 'received:209.85': 0.36; 'url:library': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'setting': 0.37; 'seem': 0.37; 'received:209': 0.38; 'mean': 0.38; 'means': 0.39; 'does': 0.39; 'some': 0.40; 'believe': 0.66; 'skip:\xe2 10': 0.70; '8bit%:43': 0.72; 'url:en-us': 0.72; 'to:none': 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:cc :content-transfer-encoding; bh=iiAr1cYvrx1NEd5fLl8UQ1TEc+EJldTOdnGOVV3w2MI=; b=MD5j9NlNJ7bgLp32cO8SB03wfaPi6TRVNF+TZO6WXdKOztcAHQjwsFp6iv3XOs1bfN Qm4YmzIlCeQv3uKDvc67tIfwjQ1bp7xPs2bzPBO2ubcd7Zsc8szLVYwejSn7xoIIADya pXRBUXT0kEP90bwrrYI9cLSR58xd8hy45dIYEcPjniZrL20QobbKlE03qwOLk1l8sYvQ CzXnNCOT0MYnp7XuB6UfKi/87Kkk0en3q0NZJ7degP6K9Fqz8IfQ0EApO/BlL4NHMyrV nYN/Lc5OcqiaTibYrW2PmO6OpfVZEPhCwjuLYgROE3GitORq5Xna8x0nDzHoL1R2HaBX urEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:cc:content-transfer-encoding; bh=iiAr1cYvrx1NEd5fLl8UQ1TEc+EJldTOdnGOVV3w2MI=; b=bjTsWFAQwX3JZgRMJLlxTPw0Zq2ZFOpTT7bMb6sbgEW0smn8exHJZzlDk0Yh/vcamO wN4KWaqWpDwkgJarZh21P1b5UM0hywJ7Bhl/WoV7wQFsY8s2pLU7Q+hnnpwV2/mVSVhN BfjFykNJmSUV3sE7bTkaCzSPKpE92SjxCaLJgaYq7DAka6zOnRHjt4Uuw17BfAfAYNFx HHXjLvia0NnTVBap00MQiNyUT9qSxNIpYreH2HgVbFeZmHXL/+PEyxoMeW/rIjETT5+G t8qV1/q5ZSdZRmKQr4UtqOol3YQO2nR2Y3HXzMnS8nYxfGNWlppsrVEwQm9k3jpNJJeH n6TA== X-Gm-Message-State: ALyK8tIEAD1jGTePm2mbZNX/7RT1hZGUPRuqHy8bm/6rqcCK9F7XWhAoJKZQMv1kuHsVJcaNMj5CpCQowz3bvQ== X-Received: by 10.157.37.6 with SMTP id k6mr2630327otb.115.1464890155851; Thu, 02 Jun 2016 10:55:55 -0700 (PDT) In-Reply-To: <57506e90$0$1602$c3e8da3$5496439d@news.astraweb.com> 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: X-Mailman-Original-References: <80ea0ea1-5468-2dee-2c38-c2b09801d0f1@shopzeus.com> <85h9de6lp4.fsf@benfinney.id.au> <52defc17-a6e6-4f7e-a91d-4e1e3b263b55@googlegroups.com> <57506e90$0$1602$c3e8da3$5496439d@news.astraweb.com> Xref: csiph.com comp.lang.python:109376 On Thu, Jun 2, 2016 at 11:36 AM, Steven D'Aprano wrot= e: > On Thu, 2 Jun 2016 06:22 pm, Lawrence D=E2=80=99Oliveiro wrote: > >> On Wednesday, June 1, 2016 at 8:02:14 AM UTC+12, Ben Finney wrote: >>> (Note that =E2=80=98__init__=E2=80=99 is not a constructor, because it = operates on the >>> *already constructed* instance, and does not return anything. >> >> Believe it or not, that *is* what =E2=80=9Cconstructor=E2=80=9D means in= every OO >> language. > > I don't believe it. > > C# is an OO language, and it distinguishes constructors and initialisers: > > https://msdn.microsoft.com/en-us/library/bb397680.aspx > > (although they don't seem to mean quite the same as what they mean in > Python). Indeed. The "constructor" in that example is the equivalent of the Python __init__ method. The "initializer" is not a part of the class at all but just a syntactic sugar for creating an instance and setting some of its properties at the same time in a single statement. It's very similar to the C array initializer syntax, e.g.: int myArray[] =3D {1, 2, 3, 4, 5};