PEP 328 update
Scott David Daniels
Scott.Daniels at Acm.Org
Mon May 3 11:55:03 EDT 2004
Aahz wrote:
> PEP 328 (``import`` changes) has been updated and is available at
> http://www.python.org/peps/pep-0328.html
>
> Comments on the revised version are welcome. One area where feedback is
> particularly desired is on the frequency of relative imports inside
> packages in current code, both in absolute terms and as a percentage of
> all imports.
I am unclear as to why "import ..moduleA as A" is not allowed. The only
rationale given for disallowing relative imports like "import .foo" is
that .foo is unacceptable as a name. I'd propose a mandatory AS-clause
if the MODULE begins with a period.
This would allow me to do something like "import . as mypackage" -- a
case which is perhaps unnecessary. I just found the "must use the
from-style imports" surprising (I agree the change is not vital).
--
-Scott David Daniels
Scott.Daniels at Acm.Org
More information about the Python-list
mailing list