[Python-Dev] question/comment about documentation of relative imports
phd at phd.pp.ru
Tue Oct 5 23:41:17 CEST 2010
On Wed, Oct 06, 2010 at 07:09:48AM +1000, Nick Coghlan wrote:
> The remaining scenarios we have that can lead to duplication of a
> module happen regardless of the import style you use*.
> *For the curious - those scenarios relate to ending up with the same
> module present both as "__main__" and under its normal module name.
I remember falling in the trap of importing the same module twice by
manipulating sys.path and changing cwd (current working directory); the
module was imported from different paths - from the current directory
(entry '.' in the sys.path) and by its full path.
Oleg Broytman http://phd.pp.ru/ phd at phd.pp.ru
Programmers don't die, they just GOSUB without RETURN.
More information about the Python-Dev