[issue29114] __class__ not exists in the method which bounded by types.MethodType.

2016-12-30 Thread lanf0n
lanf0n added the comment: thanks xiang, Nick, I might misunderstood MethodType to bound method will work as class definition. It might not good to enhance MethodType to work as class definition, same problem on patching method to a class as Nick explained

[issue29114] __class__ not exists in the method which bounded by types.MethodType.

2016-12-29 Thread lanf0n
New submission from lanf0n: test code below: ```python >>> from types import MethodType >>> class A: ... def f(self): ... print(__class__) ... >>> a = A() >>> a.fn = MethodType(lambda s: print(__class__), a) >>> >>> a.f() >>&