Proposal: default __init__

Andrew Kuchling akuchlin at mems-exchange.org
Mon Nov 13 17:14:44 EST 2000


"Alex Martelli" <aleaxit at yahoo.com> writes:
> Am I having hallucinations, are Michael Hudson
> (and AMK) having them, or did this use to work
> differently in some ancient Python (before 1.5.2,
> which is where I came in...) and was fixed in
> the last couple of years or so...?

No, I was simply wrong when I wrote the text; B.__init__ will call B's
__init__ method if it exists, and otherwise fall back to A.__init__.
This means the flaw is much smaller -- as long as there's an __init__
method defined by a superclass, B.__init__ will always work.

The list does need to be updated to take 2.0 into account, too.

--amk




More information about the Python-list mailing list