> There's been some discussion on c.l.py about whether the > new relative import system should allow things like > > import ..abc as def > > It seems the PEP currently disallows this, but nobody > seems to be able to adequately explain why. Is there > any technical reason it couldn't be done? Because "import ..abc" is clearly nonsense, since after "import X" you should be able to the imported entity as "X" in your program, and "..abc" is not a valid expression. This doesn't strictly apply to "import ..abc as xyz" ("def" was a poor choice for "X" :-), but it doesn't seem worth stretching the syntax when you can already do that using "from .. import abc as xyz". --Guido van Rossum (home page: http://www.python.org/~guido/)
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