Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #30508

Re: Should one always add super().__init__() to the __init__?

Path csiph.com!usenet.pasdenom.info!gegeweb.org!usenet-fr.net!nerim.net!novso.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <ian.g.kelly@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.123
X-Spam-Level *
X-Spam-Evidence '*H*': 0.77; '*S*': 0.01; 'difference,': 0.09; 'sep': 0.09; 'subclasses': 0.09; 'sat,': 0.15; 'wrote:': 0.17; 'header :In-Reply-To:1': 0.25; 'am,': 0.27; 'possibility': 0.27; 'message- id:@mail.gmail.com': 0.27; 'class': 0.29; 'classes': 0.30; '(and': 0.32; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'subject:?': 0.35; 'received:209.85': 0.35; 'add': 0.36; 'should': 0.36; 'received:209': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'little': 0.39; 'header:Received:5': 0.40; 'think': 0.40; 'maintenance': 0.65; 'subject:always': 0.84; 'to:name:python': 0.84; 'subject:add': 0.91; 'inheritance,': 0.93
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=Iq0JkoZIpz5QUBsjn0rgTZCN9BH0zkGJGEHTZJwlyG4=; b=dLKpsBnXRtuSTL4QDojAOAfQ/NSZY4vyXeFj7zmfJfIND1RcIm84Pqf7YNB2EjMaXc wMqa5bcYtpHvqTYkIcRpztNvU6cCTtCaoKCi2HifNtP09bTsSklQFQxc+zoftXDq5kpR oRA4q9tI4oIE5pE06UIZ28I99ktT/aQpNg2KQDgkGYXNal83ydo7ixXMscguCdKxgh+P hxoZAauj/w05F8BIFegq1GyJSK1vyzERz7BHj5E7/Ek5DTDeGBBkS/uTZsEHHu9R1iiT 5UapEhjKtENiLWlhUkVe6lNdNK+kFUmqO4EY4L4zM9eibE6uIY62XCE7rCabrOfPKXyx 9UIg==
MIME-Version 1.0
In-Reply-To <d8fc9d99-8dc0-4290-88a0-33cd38d09f7d@googlegroups.com>
References <d8fc9d99-8dc0-4290-88a0-33cd38d09f7d@googlegroups.com>
From Ian Kelly <ian.g.kelly@gmail.com>
Date Sat, 29 Sep 2012 10:59:16 -0600
Subject Re: Should one always add super().__init__() to the __init__?
To Python <python-list@python.org>
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 <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1640.1348937989.27098.python-list@python.org> (permalink)
Lines 6
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1348937989 news.xs4all.nl 6920 [2001:888:2000:d::a6]:55316
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:30508

Show key headers only | View raw


On Sat, Sep 29, 2012 at 7:27 AM, Ramchandra Apte <maniandram01@gmail.com> wrote:
> Should one always add super().__init__() to the __init__? The reason for this is the possibility of changing base classes (and forgetting to update the __init__).

As long as the class and its subclasses only use single inheritance,
it makes little difference, so if you think it will reduce the
maintenance burden, I would say go for it.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Should one always add super().__init__() to the __init__? Ramchandra Apte <maniandram01@gmail.com> - 2012-09-29 06:27 -0700
  Re: Should one always add super().__init__() to the __init__? Ramchandra Apte <maniandram01@gmail.com> - 2012-09-29 06:28 -0700
  Re: Should one always add super().__init__() to the __init__? Ian Kelly <ian.g.kelly@gmail.com> - 2012-09-29 10:59 -0600
  Re: Should one always add super().__init__() to the __init__? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-09-29 17:17 +0000
    Re: Should one always add super().__init__() to the __init__? Devin Jeanpierre <jeanpierreda@gmail.com> - 2012-09-29 14:18 -0400
    Re: Should one always add super().__init__() to the __init__? Chris Angelico <rosuav@gmail.com> - 2012-09-30 04:31 +1000
      Re: Should one always add super().__init__() to the __init__? Piet van Oostrum <piet@vanoostrum.org> - 2012-09-29 17:51 -0400
        Re: Should one always add super().__init__() to the __init__? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-09-30 04:40 +0000
          Re: Should one always add super().__init__() to the __init__? Ian Kelly <ian.g.kelly@gmail.com> - 2012-09-30 00:08 -0600
            Re: Should one always add super().__init__() to the __init__? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-09-30 09:34 +0000
              Re: Should one always add super().__init__() to the __init__? Manuel Pégourié-Gonnard <mpg@elzevir.fr> - 2012-09-30 14:04 +0200
      Re: Should one always add super().__init__() to the __init__? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-09-30 04:37 +0000
        Re: Should one always add super().__init__() to the __init__? Chris Angelico <rosuav@gmail.com> - 2012-09-30 14:53 +1000
        Re: Should one always add super().__init__() to the __init__? Ian Kelly <ian.g.kelly@gmail.com> - 2012-09-30 01:13 -0600
    Re: Should one always add super().__init__() to the __init__? Ramchandra Apte <maniandram01@gmail.com> - 2012-09-29 20:14 -0700
      Re: Should one always add super().__init__() to the __init__? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-09-30 04:23 +0000
        Re: Should one always add super().__init__() to the __init__? Ramchandra Apte <maniandram01@gmail.com> - 2012-09-29 21:55 -0700
          Re: Should one always add super().__init__() to the __init__? Ian Kelly <ian.g.kelly@gmail.com> - 2012-09-30 00:10 -0600

csiph-web