A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2004-May/044728.html below:

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

[Python-Dev] PEP 328: import...as with relative import [Python-Dev] PEP 328: import...as with relative importBob Ippolito bob at redivi.com
Sun May 9 21:17:53 EDT 2004
On May 9, 2004, at 9:03 PM, 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.

Either way, right now it's a real pain when you have a relative and 
absolute module with the same name.  You simply can't import the 
absolute one by standard means.  It would be at least nice if you could 
explicitly state that some import should be absolute (given the current 
relative-first search order).  I generally use absolute imports 
everywhere, because I've found it generally avoids problem -- but it 
certainly wasn't my first instinct when learning Python.

-bob


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4