[Tutor] Modify inherited methods
Eike Welk
eike.welk at gmx.net
Wed Apr 28 20:09:19 CEST 2010
On Wednesday April 28 2010 13:04:30 Steven D'Aprano wrote:
> On Wed, 28 Apr 2010 04:53:06 pm Walter Wefft wrote:
> > Steven D'Aprano wrote:
> > > And for guru-level mastery, replace to call to dict.__init__ with
> > > ...
> >
> > nothing at all, because dict.__init__ doesn't do anything.
>
> [...]
>
> > Behaviour is different depending on whether you call the superclass
> > __init__ or not.
> >
> > ?
>
> Fascinating... it seems that you are correct. Just goes to show, you can
> be programming in Python for well over a decade and still learn
> something new.
You probably thought of tuple, where __init__ really does nothing. Tuple
instances are created by __new__.
Eike.
More information about the Tutor
mailing list