Getting the module name from a method...

Greg Ewing greg.ewing at compaq.com
Wed Aug 18 00:26:35 CEST 1999


"Stephen J. Turner" wrote:
> 
> How about "self.__class__.__module__"?

No, that will give you the module of the
instance's class. This is not necessarily
the same as the class defining the currently
running method, which could be an inherited
class.

Greg




More information about the Python-list mailing list