[Python-bugs-list] [ python-Bugs-452230 ] future division isn't propagated

noreply@sourceforge.net noreply@sourceforge.net
Fri, 17 Aug 2001 14:41:01 -0700


Bugs item #452230, was opened at 2001-08-17 14:36
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=452230&group_id=5470

Category: Python Interpreter Core
Group: None
Status: Open
Resolution: None
Priority: 7
Submitted By: Tim Peters (tim_one)
>Assigned to: Tim Peters (tim_one)
Summary: future division isn't propagated

Initial Comment:
When I first saw this, I thought it was a bug in the 
PEP 264 patch.  Then I thought it was because 
PyEval_MergeCompilerFlags hadn't been taught about 
CO_FUTURE_DIVISION.  But I just repaired (and checked 
in) the latter, so that's not it either (although that 
was a cause of related bugs).  If it's not more 
obvious to you than it is to me, assign it back to me 
and I'll get back to it later.

C:\Code\python\PCbuild>python
Python 2.2a1+ (#21, Aug 17 2001, 17:16:14) [MSC 32 bit 
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for 
more information.
>>> from __future__ import division
>>> 1/2
0.5
>>> eval("1/2")
0
>>>

The same thing happens if you run it from file:

from __future__ import division
print 1/2
print eval("1/2")

That prints "0.5" and "0".


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

>Comment By: Guido van Rossum (gvanrossum)
Date: 2001-08-17 14:41

Message:
Logged In: YES 
user_id=6380

Looks to me like builtin_eval() doesn't do the necessary
dance to pass in any compiler flags -- it uses the old API,
PyRun_String().

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

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=452230&group_id=5470