PEP 328: Imports: Multi-Line and Absolute/Relative
bh at intevation.de
Mon Mar 15 12:26:54 CET 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.
Intevation GmbH http://intevation.de/
More information about the Python-list