Bugs item #1385055, was opened at 2005-12-19 10:15
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1385055&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Interpreter Core
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Harri Pasanen (harripasanen)
Assigned to: Nobody/Anonymous (nobody)
Summary: execfile anomaly with "from __future__ import division"

Initial Comment:
If I have a file init.py with two lines: 
 
from __future__ import division 
print 3/4 
 
and I do  
 
[EMAIL PROTECTED] tests]$ python 
Python 2.4 (#1, Feb 16 2005, 01:23:25) 
[GCC 3.4.3 (Mandrakelinux 10.0 3.4.3-2mdk)] on linux2 
Type "help", "copyright", "credits" or "license" for 
more information. 
>>> execfile('init.py') 
0.75 
>>> 3/4 
0 
 
I would have expected the latter to return 0.75 as 
well. 
 
Due to this it seems impossible to provide init code 
that would initialize the interactive prompt to 
future division behaviour. 
 
The same applies to exec statement. 
 
I'm not sure if this is bug, or an unfortunate 
feature.  The documention is not very clear on this 
issue. 
 
-Harri 

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1385055&group_id=5470
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to