Christian Heimes wrote:
Philip Guo wrote:
Does anyone know how to get this information either from a code object or
from a related object?  I am hacking the interpreter, so I have full access
to everything.

Does this help?

class A(object):
...     def method(self):
...         pass
...
A.method.im_class
<class '__main__.A'>

In 3.x, A.method is the function, not a wrapper, so this will not work.

But as I said before, if one has class A 'in hand', it seems pointless to go looking for it.

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

Reply via email to