Steve Holden wrote: > Michele Simionato wrote: > > (I don't believe I am responding to a notorious troll ...) > > > Believe it. You are. Ain't life a bitch? :-) > > > One (bad) solution is to write in your sitecustomize.py the following: > > > > $ echo /usr/lib/python/sitecustomize.py > > import __builtin__ > > > > class Object(object): > > def debug(self): > > print 'some debug info' > > > > __builtin__.object = Object > > > > then you can do for instance > > > > > >>>>class C(object): pass > >>>>C().debug() > > > > some debug info > > > > All class inheriting from object will have the additional debug method. > > But sadly not the built-in types like int and str, which is what our > trollish friend wants to do (for some reason best known to himself). >
Followup thread: [Watching this topic] CONSTRUCT - New/Old Style Classes, build-in/extension types http://groups.google.com/group/comp.lang.python/browse_frm/thread/493d71f3dd09939b -- http://mail.python.org/mailman/listinfo/python-list