Thomas Heller a écrit :
I'm currently using code like this to create unbound methods
from functions and stick them into classes:

   method = new.instancemethod(raw_func, None, cls)
   setattr(cls, name, method)

setattr(cls, name, func) would work better - given that either isinstance(raw_func, function) or raw_func.__get__ is implemented the right way.

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to