Shouldn't __init__ return self instead of None? (Was: Re: [Tutor] Why error if method __init__ does not return none)

Michael Hudson mwh at python.net
Sun Mar 23 11:11:05 CET 2003


Gerrit Holl <gerrit at nl.linux.org> writes:

> This raises an interesting question. Shouldn't it say: __init__ should
> return self...? Because _that_ is what it really does...

As Martin said, __init__ is an initializer.  Think about the name :-)

Cheers,
M.

-- 
  GET   *BONK*
  BACK  *BONK*
  IN    *BONK*
  THERE *BONK*             -- Naich using the troll hammer in cam.misc




More information about the Python-list mailing list