[Python-Dev] Fix import errors to have data

Bob Ippolito bob at redivi.com
Thu Jul 29 00:40:34 CEST 2004

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.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3589 bytes
Desc: not available
Url : http://mail.python.org/pipermail/python-dev/attachments/20040728/d372842c/smime.bin

More information about the Python-Dev mailing list