[IPython-dev] Where should __future__ statements affect the interactive environment.
Hans Meine
hans_meine at gmx.net
Wed Apr 25 15:56:05 EDT 2012
Am Dienstag, 24. April 2012, 00:04:31 schrieb Jörgen Stenarson:
> To me it makes most sense to not import any __future__ into the global
> namespace unless explicitly asked for by some option (like %run -i). In
> short I would prefer to be explicit about what ends up globally.
I felt exactly the same, namely that '%run foo.py' should behave similar to
'python foo.py' and *not* import the __future__s, while '%run -i foo.py' is
more like execfile and should import them.
Even if -i is mostly used (AFAICS) for transferring bindings /into/ the script
context, it is actually documented as "run the file in IPython's namespace
instead of an empty one", which would IMHO lead to the above semantics.
Best regards,
Hans
More information about the IPython-dev
mailing list