[Python-Dev] 2.6 object.__init__ & deling __new__
Dino Viehland
dinov at microsoft.com
Tue Jul 14 23:25:34 CEST 2009
Benjamin wrote:
> There's a wonderful comment about this in typeobject.c:
>
This is basically the same what I've gathered from the issue
description which was quite helpful. But in this case we're
dealing with mutating the type object and changing whether
__new__ or __init__ exist at all at runtime - and
object.__new__/__init__ don't seem to be picking up on the
change.
I believe that the comments here w.r.t. mutability/immutability
are more about whether the instances are immutable and not
the type objects themselves - for example list vs tuple where
tuple has __new__ but no __init__.
Based upon the behavior I'm seeing it seems to me that the
presence of __new__ / __init__ must be getting cached somewhere
and the deletion isn't updating the cache and that's specifically
what struck me as odd here.
More information about the Python-Dev
mailing list