Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #30543
| References | <d8fc9d99-8dc0-4290-88a0-33cd38d09f7d@googlegroups.com> <50672d20$0$29981$c3e8da3$5496439d@news.astraweb.com> <mailman.1650.1348943511.27098.python-list@python.org> <m23920jy5a.fsf@cochabamba.vanoostrum.org> <5067cd36$0$29981$c3e8da3$5496439d@news.astraweb.com> |
|---|---|
| From | Ian Kelly <ian.g.kelly@gmail.com> |
| Date | 2012-09-30 00:08 -0600 |
| Subject | Re: Should one always add super().__init__() to the __init__? |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.1663.1348985321.27098.python-list@python.org> (permalink) |
On Sat, Sep 29, 2012 at 10:40 PM, Steven D'Aprano <steve+comp.lang.python@pearwood.info> 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.
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll 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