This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rhettinger
Recipients rhettinger
Date 2014-12-17.02:30:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1418783430.85.0.171264628982.issue23069@psf.upfronthosting.co.za>
In-reply-to
Content
Future imports in a module aren't transferring to the interactive shell when executing Run Module.

Given the file tmp_future.py
----------------------------
$ cat tmp_future.py
from __future__ import division, print_function

print(32 / 5)

Run Python interactively
------------------------
$ python2.7 -i tmp_future.py 
6.4
>>> 32 / 5          # this works fine!
6.4

But open the file in IDLE and press F5:
---------------------------------------
Python 2.7.9 (v2.7.9:648dcafa7e5f, Dec 10 2014, 10:10:46) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "copyright", "credits" or "license()" for more information.
>>> ================================ RESTART ================================
>>> 
6.4
>>> print(32 / 5)       # this is broken!
6

Note, the problem may also apply to IDLE Python 3.4 and 3.5 but it won't affect this example because the future imports have not effect.
History
Date User Action Args
2014-12-17 02:30:30rhettingersetrecipients: + rhettinger
2014-12-17 02:30:30rhettingersetmessageid: <1418783430.85.0.171264628982.issue23069@psf.upfronthosting.co.za>
2014-12-17 02:30:30rhettingerlinkissue23069 messages
2014-12-17 02:30:30rhettingercreate