Ole Streicher wrote:

> Peter Otten <__pete...@web.de> writes:
>> class Method(object):
>>     def __init__(self, obj, func=None):
>>         if func is None:
>>             func = obj.im_func
>>             obj = obj.im_self
> 
> This requires that func is a bound method. What I want is to have a
> universal class that "always" works: with unbound functions, with
> bound function, with lambda expressions, with locally defined functions,

That's left as an exercise to the reader ;)

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

Reply via email to