[Python-Dev] PEP 328 and PEP 338, redux

Nick Coghlan ncoghlan at gmail.com
Wed Jun 28 09:15:13 CEST 2006

Guido van Rossum wrote:
> However, I'm fine with setting *another* variable to the full package
> name so someone who *really* wants to do relative imports here knows
> the package name.

OK, I'll do that. Any objections to __module_name__ as the name of the
variable? (to keep things simple, run_module() will always define the
variable, even if __name__ and __module_name__ say the same thing).

I'll then put a note in PEP 338 about the necessary hackery to make relative 
imports work correctly from a main module - I don't see any reason to include 
something like that in the normal docs, since the recommended approach is for 
main modules to use absolute imports.


Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia

More information about the Python-Dev mailing list