[Python-Dev] Relative vs. absolute imports

Bernhard Herzog bh at intevation.de
Mon May 17 11:39:42 EDT 2004


Guido van Rossum <guido at python.org> writes:

>> Why does it have to be fixed in an incompatible way?
>
> Because in the current situation the meaning of an import is
> ambiguous.

What exactly is ambiguous about it?  There are clear rules how the
lookup is performed and determining whether the import refers to another
module in the same package or a global module is just a simple directory
listing in most cases.

The only real problem with the current scheme is that sibling modules
can shadow global ones.  While that should be fixed it hardly justifies
an incompatible change, as it doesn't happen very often, and it would be
easy to fix without breaking compatibility.

   Bernhard

-- 
Intevation GmbH                                 http://intevation.de/
Skencil                                http://sketch.sourceforge.net/
Thuban                                  http://thuban.intevation.org/



More information about the Python-Dev mailing list