making a class return None from __init__

Aahz aahz at
Sat Oct 5 01:47:00 CEST 2002

In article <3D9E0E80.36F8E03D at>,
Erik Max Francis  <max at> wrote:
>The proper way to handle this case is to raise an exception from the
>constructor if something goes wrong.  

__init__() is *NOT* a constructor, it's an initializer.  If you want a
constructor, inherit from object and use __new__().
Aahz (aahz at           <*>

Project Vote Smart:

More information about the Python-list mailing list