On 6/12/10 12:59 PM, Giampaolo Rodolà wrote: > Clear, thanks. > Isn't there a prettier/common way to do this? > A __methodcall__(self, method_obj) special method or something? Has > something like that ever been proposed for inclusion?
Not really, because that doesn't actually fit into the object model. A class isn't actually involved with the calling of the method: once the class returns it, the method's own __call__ is invoked later on. The class is completely out of touch at that point. The idiomatic way is really returning a wrapped function-- or using decorators (which is just more explicit wrapping), I think. -- Stephen Hansen ... Also: Ixokai ... Mail: me+list/python (AT) ixokai (DOT) io ... Blog: http://meh.ixokai.io/
signature.asc
Description: OpenPGP digital signature
-- http://mail.python.org/mailman/listinfo/python-list