[Python-Dev] Re: Relative import (original) (raw)
Ken Manheimer klm at zope.com
Thu Dec 18 12:20:30 EST 2003
- Previous message: [Python-Dev] Re: Relative import
- Next message: [Python-Dev] Re: Relative import
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
+1 for the '.' proposal, where (to verify my understanding):
'.' indicates "import from the current package", '..' means "import from the package of my package", and so forth,
imports where the package part lacks a leading '.' are absolute, ie from the top level of the path.
-1 for the '...' proposal, where '...' means a search from the current package up to the most superior containing package (which is actually a virtual package that entails the entire path).
Ie, i am for absolute being the default and explicit-relative being available, and against ambiguous relative aka scanning the hierarchy. (I might be convinced otherwise about the scanning deal, but i think the more deterministic we can make imports, while still keeping them flexible enough to do what people need, the better.)
I also like your proposal for a "no ambiguous imports" flag
from future import absolute_import
Ken klm at zope.com
- Previous message: [Python-Dev] Re: Relative import
- Next message: [Python-Dev] Re: Relative import
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]