[Python-Dev] PEP 328: import...as with relative import

Aahz aahz at pythoncraft.com
Sun May 9 21:44:09 EDT 2004


On Mon, May 10, 2004, Greg Ewing wrote:
> Nick Coghlan <ncoghlan at iinet.net.au>:
>> 
>> The other point in favour of the current way is that a bare import 
>> statement is *always* absolute, which further encourages absolute 
>> imports as the standard approach.
> 
> I don't understand why absolute imports should be regarded as the
> "standard approach". Absolute imports are appropriate for some things,
> relative imports are appropriate for other things. You can't say that
> one is "standard" and the other isn't.

The way I'd put it is that relative imports are used only by experts:
people building chunks of Python code large enough to require packages.
Therefore absolute imports make more sense as the default.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

Adopt A Process -- stop killing all your children!



More information about the Python-Dev mailing list