Luke wrote:
> Thanks James, though from the output of b.x() it appears that x is a
> class method (ie the class is passed as the first parameter rather than
> the instance)...
> 

Sorry, the one line was probably supposed to be

b = bob()

I forgot the parens:

py> b = bob()
py> b.x = types.MethodType(doit, b)
py> b.x()
<__main__.bob instance at 0x404afb6c>
py> b.x
<bound method ?.doit of <__main__.bob instance at 0x404afb6c>>

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

Reply via email to