Public imports

skip at pobox.com skip at pobox.com
Mon Dec 8 19:57:10 CET 2008


    Márcio> So, no chance of doing this:
    Márcio> # "A.py"
    Márcio> from __future__ import division, with_statement

    Márcio> # "B.py"
    Márcio> from A import *
    Márcio> print 1 / 2

    Márcio> ...and printing 0.5, right? Too bad :)

"from __future__ ..." isn't really an import statement in the usual sense of
the term.  It affects the byte code compiler immediately and I believe only
when using that syntax.  That it actually adds a name to the module's
namespace is not really used (at least, not often).

-- 
Skip Montanaro - skip at pobox.com - http://smontanaro.dyndns.org/



More information about the Python-list mailing list