How can a module find its own module object?

Oren Tirosh oren-py-l at hishome.net
Sun Dec 23 15:51:05 EST 2001


'import myname' is not exactly a reliable way to get your own module
object - the file may be renamed, placed in a package, affected by
case-sensitivity problems, loaded from somewhere not in the path, etc.

Is there any other way for a module to find itself other than searching 
sys.modules for a module whose __dict__ is globals()?

	Oren




More information about the Python-list mailing list