Guido van Rossum <guido at python.org> writes: >> > Because in the current situation the meaning of an import is >> > ambiguous. >> >> What exactly is ambiguous about it? > > Looking at "import foo" you can't tell whether there's a module foo > expected in the current package or in the top-level module namespace. Well, looking at "print foo" I can't tell whether its a local variable, a global variable or a builtin either. Nobody's going to suggest we should introduce special syntax to distinguish them, I hope. Module import isn't much different and it's only a little harder to figure out whether its a relative import or not, and you only have to distinguish them when the importer is a module in a package. I've been using packages in the current form ever since they've been introduced in Python 1.5. In all that time, relative imports have never been a problem for me, IIRC, and I use them for all sibling imports. Absolute imports have their own difficulties, too, btw, and relative imports don't add much complexity on top of that. I don't think the ambiguity, if you want to call it that, is enough of a problem to justify the incompatibility. Bernhard -- Intevation GmbH http://intevation.de/ Skencil http://sketch.sourceforge.net/ Thuban http://thuban.intevation.org/
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