Modify __new__ attribute for inmutable types in Python -
im trying modify behaviour of 'int' type in python.
it says
'__new__' readonly.
is there way it?
thanks.
you can't modify built-in type, can derive it:
class myint(int): def __new__(cls, *args): # whatever
Comments
Post a Comment