Bruno Desthuilliers <bruno.42.desthuilli...@websiteburo.invalid> writes:
>> The print command inside the __init__ method isn't executed, so that >> method doesn't seem to start at all. > > this often happens with (usually C-coded) immutable types. The > initializer is not called, only the "proper" constructor (__new__). More specifically, __init__ is called, but only after __new__ has finished, and __new__ gets the arguments passed in the constructor expression. Since __new__ raises an exception for those arguments, __init__ is never reached. The fix is in such cases is, as you point out, to override __new__ and not bother with __init__ at all. -- http://mail.python.org/mailman/listinfo/python-list