[Python-Dev] Re: PEP 328 -- relative and multi-line import

Jeremy Hylton jeremy at alum.mit.edu
Mon Apr 12 09:41:02 EDT 2004


On Mon, 2004-04-12 at 10:06, Barry Warsaw wrote:
> Would that be any different than if modules of the subpackage add the
> __future__ in them?  I'm envisioning semantics such that a __future__ in
> an __init__.py was the same as if that __future__ was explicitly added
> to every module (i.e. it's a convenience).

I think they belong in every module.  A future statement is a compiler
gimmick and modules are compiled separately, so each module ought to
have its own future statement.  If not, the compiler (and human reader)
have no idea whether a future statement is in effect.  Obviously, the
compiler and the reader could learn about some change to import
semantics by studying context, but that's extra complexity I'd like to
avoid (particular in the case of the compiler).

Jeremy





More information about the Python-Dev mailing list