PEP 328: Imports: Multi-Line and Absolute/Relative

Bernhard Herzog bh at intevation.de
Mon Mar 15 06:26:54 EST 2004


and-google at doxdesk.com (Andrew Clover) writes:

>> A package writer does know which external modules/packages he needs
>> and can avoid to use the name of one of these modules for his
>> own modules.
>
> But it's not just used in packages, where the filenames of sibling
> modules are known. There may be scripts in directories with many
> unrelated files, for which relative importing would be highly
> undesirable (or even, in a directory where someone other than the
> owner has write-access, a possible security risk).

That's a completely different issue.  The pep is about relative imports
in a package.  The problem you describe comes from Python inserting the
directory containing the script to sys.path.

   Bernhard

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



More information about the Python-list mailing list