using extended built-in types

Rim rimbalaya at
Sun Jun 29 22:48:55 CEST 2003


When I extend a built-in type, how do I cause the extended type to
be used by default, without having to specify it? For instance, say I
extend the int type:

class myint(int):
   def foo(self): print 'foo'

How do I make all future integers use myint instead of int without explicitely
say a = myint(value)?

- Rim

More information about the Python-list mailing list