[Python-Dev] Puzzling behavior when subclassing from float
Guido van Rossum
guido@python.org
Fri, 20 Sep 2002 12:42:14 -0400
> Aplogies in advance if this is the wrong forum for this question.
It is, but because you're you, I don't mind.
You're missing that besides __init__, new-style classes also have a
lower-level constructor, __new__. This is called before __init__.
For immutable objects, __new__ is where the action is. Read about it
in http://www.python.org/2.2.1/descrintro.html
--Guido van Rossum (home page: http://www.python.org/~guido/)