On Apr 5, 2:02 pm, s...@pobox.com wrote: > Is there a replacement in Python3 for new.instancemethod? That is, given an > arbitrary instance (not its class) how can I add a new appropriately defined > function as a method to it?
There is no need for new.instancemethod for new style classes: >>> class C: pass ... >>> c=C() >>> def f(self): pass ... >>> c.f = f.__get__(c, C) >>> c.f <bound method C.f of <__main__.C object at 0xb7b6fdec>> -- http://mail.python.org/mailman/listinfo/python-list