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

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

javascript - Preserving URL fragment through CAS sign-on -

asp.net mvc - Implementing normal user/pass, Twitter & Facebook auth -