[Python-Dev] Breaking calls to object.__init__/__new__

Guido van Rossum guido at python.org
Thu Mar 22 15:36:28 CET 2007

On 3/21/07, Blake Ross <blake at firefox.com> wrote:
> At 09:41 PM 3/21/2007 -0700, Guido van Rossum wrote:
> > Also make a big distinction between super calls of __init__ (which are
> > a Pythonic wart and don't exist in other languages practicing multiple
> > inheritance AFAIK)
> Since I filed the bug, I should clarify that the primary reason I'm
> using super-init is to avoid multiple construction of a shared base
> (even if the base is just object, since I'd prefer not to rely on
> object's initializer being a no-op). C++ ensures that virtual bases
> are only constructed once, so there's no concern as to multiple
> construction. Is there a Python pattern better than super-init that
> provides the same guarantee?
> (Apologies if this appears in the wrong place; I just joined the list
> and I'm not seeing a way to participate in an existing thread.)

Welcome to the group! You seem to have stirred up quite the discussion.

Regarding where to ask for advice on that particular issue, python-dev
is *not* the place; comp.lang.python would be more appropriate. Though
perhaps Greg Ewing's suggestion is all you need. :-)

--Guido van Rossum (home page: http://www.python.org/~guido/)

More information about the Python-Dev mailing list