Message380870
This is because int, str, and complex are immutable. If I have
class MyInt(int):
def __init__(self, stuff):
pass
then when I call MyInt("19"), the string "19" is passed to the constructor int.__new__ before the overridden initializer MyInt.__init__. You can only override that by implementing a MyInt.__new__ to override the int constructor.
This is not a bug. |
|
Date |
User |
Action |
Args |
2020-11-13 05:36:10 | Dennis Sweeney | set | recipients:
+ Dennis Sweeney, autospamfighter |
2020-11-13 05:36:10 | Dennis Sweeney | set | messageid: <1605245770.68.0.810728354716.issue42334@roundup.psfhosted.org> |
2020-11-13 05:36:10 | Dennis Sweeney | link | issue42334 messages |
2020-11-13 05:36:10 | Dennis Sweeney | create | |
|