[Python-bugs-list] [ python-Bugs-496549 ] -Qnew and in-place division "/="
noreply@sourceforge.net
noreply@sourceforge.net
Tue, 25 Dec 2001 10:49:45 -0800
Bugs item #496549, was opened at 2001-12-24 13:02
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=496549&group_id=5470
Category: Python Interpreter Core
Group: Python 2.2
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Bruce Sherwood (bsherwood)
Assigned to: Tim Peters (tim_one)
>Summary: -Qnew and in-place division "/="
Initial Comment:
(Closed bug report #488514 may be related to this bug,
as it mentions some tests failing.)
If I invoke Python 2.2 with -Qnew, there is the
following failure with in-place division:
print 5/2
a = 5
a /= 2
print a # gives 2, should give 2.5
If I insert an explicit "from __future_ import
division", the program works correctly.
Bruce Sherwood
----------------------------------------------------------------------
>Comment By: Tim Peters (tim_one)
Date: 2001-12-25 10:49
Message:
Logged In: YES
user_id=31435
Fixed in Python/ceval.c; new revision: 2.302
----------------------------------------------------------------------
Comment By: Bruce Sherwood (bsherwood)
Date: 2001-12-24 16:06
Message:
Logged In: YES
user_id=34881
You're correct that I was running from IDLE (on Windows).
In the idlefork version of IDLE, I experimented with
spawning a run with the -Qnew option and got the result I
reported. It didn't occur to me to try it from a command
line, thinking that the spawn was equivalent.
----------------------------------------------------------------------
Comment By: Tim Peters (tim_one)
Date: 2001-12-24 15:28
Message:
Logged In: YES
user_id=31435
Fudge -- this is my oversight. I think a missing piece of
info here is that you were running IDLE, right? It gives
2.5 under a native (DOS box; cmdline) shell.
If that's correct, it should be easy to repair, but
requires code changes in the core.
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=496549&group_id=5470