On 8/07/2006 11:01 AM, tac-tics wrote: > Experimenting, I found that > >>>> x.fun = lambda: fun(x) > > works as well. Any comments on this way? >
Appears to work. Less typing for a no-argument method, but you need to specify the argument list *twice* compared with *zero* times with the types.MethodType way of doing it. >>> x=K() >>> x.metho = lambda(a): own(x, a) >>> x.metho('abcde') own >>> x.ozz 'abcde' >>> -- http://mail.python.org/mailman/listinfo/python-list