[Python-Dev] Relative import (original) (raw)

Barry Warsaw barry at python.org
Mon Dec 22 09:55:16 EST 2003


On Mon, 2003-12-22 at 04:03, Troy Melhase wrote:

I don't really like the dot/triple dot notation... the leading punctuation smells perl-ish. :)

I don't either, although my biggest problem with it is that it isn't clear just by looking what the punctuation actually means. I just fear this will be a permanent head scratcher.

Here's my entry in the sure-to-be-shot-down-by-the-BDFL-alternative -syntax game:

import foo by absolute import foo.bar by relative as baz import foo by searching as bar import foo by absolute from bar import foo as bar by absolute from baz

IOW, 'by' is a reserved word in the import statement context, and it specifies how to search for modules. The question then is whether 'absolute', 'relative', and 'searching' are also reserved words or built-ins and how those names are equated with the module location algorithms.

-Barry



More information about the Python-Dev mailing list