[Python-Dev] PEP 328: import...as with relative import
Nick Coghlan
ncoghlan at iinet.net.au
Fri May 7 08:07:04 EDT 2004
Greg Ewing wrote:
> I can see your point of view. It just seems a bit strange coming at
> from the other direction -- if you can say 'import a.b as z' there
> doesn't seem to be any good reason not to say 'import ..a.b as z'. I
> can imagine people getting tripped up by this.
>
> I guess you're right that it doesn't matter much either way.
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.
It's only once someone starts playing with the 'from' syntax for import
that they need to know about the difference between absolute and
relative import.
Regards,
Nick.
--
Nick Coghlan | Brisbane, Australia
Email: ncoghlan at email.com | Mobile: +61 409 573 268
More information about the Python-Dev
mailing list