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

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -