Py2K wishes
Skip Montanaro
skip at mojam.com
Wed Dec 29 12:19:28 EST 1999
Paul> Gordon McMillan wrote:
>> If you're catching specific methods, why not subclass?
Paul> You cannot subclass objects that are passed to you.
Maybe I'm way out of context here, but can't you subclass on-the-fly with
something like:
def func(o):
class sub(o.__class__):
def __init__(self, o):
self.__dict__ = copy.copy(o.__dict__)
def othermethod(self,...):
pass
o = sub(o)
o.othermethod(...)
...
Skip Montanaro | http://www.mojam.com/
skip at mojam.com | http://www.musi-cal.com/
847-971-7098 | Python: Programming the way Guido indented...
More information about the Python-list
mailing list