◐ Shell
clean mode source ↗

Message 53547 - Python tracker

Logged In: YES 
user_id=21627

Reconsidering: It fails to work in the presence of
inheritance, right?

>>> class B:
...   def foo(self):pass
... 
>>> class D(B):pass
... 
>>> d = D()
>>> m = d.foo
>>> m.im_self
<__main__.D instance at 0x1ccb28>
>>> m.__name__
'foo'
>>> D.__dict__['foo']
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
KeyError: foo
>>>