Hello all,

 >>> class Q:
...     def bar(self):
...             pass
...
 >>> import types
 >>> types.UnboundMethodType is types.MethodType
True
 >>>
 >>> type(Q.bar)
<type 'instancemethod'>
 >>>
 >>> q = Q()
 >>> type(q.bar)
<type 'instancemethod'>
 >>>
 >>> type(q.bar) is types.UnboundMethodType
True
 >>> q.bar
<bound method Q.bar of <__main__.Q instance at 0x4042756c>>
 >>>

I think is not very consistent
notice q.bar is bounded although type(q.bar)
says it's types.UnboundedMethodType
what do you think?

Regard, Daniel

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

Reply via email to