[issue12538] Extending int class

R. David Murray report at bugs.python.org
Mon Jul 11 23:07:53 CEST 2011


R. David Murray <rdmurray at bitdance.com> added the comment:

To set the value of an immutable type you must use the __new__ method.  By the time __init__ is called the value has already be established, and in the case of int it defaults to 0.

----------
nosy: +r.david.murray
resolution:  -> invalid
stage:  -> committed/rejected
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12538>
_______________________________________


More information about the Python-bugs-list mailing list