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

Blake Ross blake at firefox.com
Thu Mar 22 07:39:44 CET 2007

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.)

More information about the Python-Dev mailing list