using extended built-in types

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


Hi,

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)?

Thanks
- Rim




More information about the Python-list mailing list