On Jul 28, 2004, at 6:13 PM, Guido van Rossum wrote:
(Oh... and another infrastructure-level issue: Python classes know their __module__ name, but in a system using module spaces, the module name alone is not sufficient to identify the module where the class originated. In Java, a class is uniquely identified by the combination of its fully qualified name, and the classloader used to load it. This is not an issue for Python functions (which reference the module globals) or for modules themselves, which both indirectly refer to the loader used to load the module. But it could be an issue for classes.)
But who ever uses __module__ for anything else than printing it?
I've used sys.modules[__module__] to get a reference to the current module object. Mostly for running doctests I guess, but I've probably used it in other places. -bob