[Python-bugs-list] [ python-Bugs-567568 ] future division broken w/ PYTHONSTARTUP

noreply@sourceforge.net noreply@sourceforge.net
Tue, 11 Jun 2002 12:38:03 -0700


Bugs item #567568, was opened at 2002-06-11 12:38
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=567568&group_id=5470

Category: Parser/Compiler
Group: Python 2.2.1
Status: Open
Resolution: None
Priority: 5
Submitted By: TEd Drain (teddrain)
Assigned to: Nobody/Anonymous (nobody)
Summary: future division broken w/ PYTHONSTARTUP

Initial Comment:
Version: 2.2.1
Compiler: gcc 2.95.3
Platform: linux (2.4 kernel)

If I create a file startup.py:
from __future__ import division
a = 1/2
print a

then setenv PYTHONSTARTUP startup.py
and launch python, it prints 0.5 like it should and the
variable a is available to me.  But, the future
division is not propagated to the interpreter.

~: setenv PYTHONSTARTUP startup.py
~: python
Python 2.2.1 (#1, May 16 2002, 16:10:22)
[GCC 2.95.3 20010315 (release)] on linux2
Type "help", "copyright", "credits" or "license" for
more information.
0.5
>>> print a
0.5
>>> 1/2
0
It looks like the compiler flags from the PYTHONSTARTUP
file are not be passed to the interpreter. 




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

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