[SciPy-dev] -Qnew option breaks scipy

Eric Nodwell nodwell at physics.ubc.ca
Sun Apr 30 15:21:25 CDT 2006


If a command line switch exists, it will be used.

According to http://www.python.org/dev/peps/pep-0238, this project:
http://www.vpython.org, has a need for running everything with -Qnew .
 I can't say whether they truely need it or not, I only point it out
as an example of the above axiom.

This is something which will have to be done eventually anyways, since
some day -Qnew will become the default.  Maybe not in the 2.x series
as you point out.  OK, I admit I'm not submitting a patch myself,
merely pointing it out in the hope that someone will say, hey I can
fix that in 5 minutes.  For all I know however a fix would require a
major rewrite of scipy.

I was using -Qnew because I often use python as an interactive
calculator and I was getting tired of typing "from __future__ import
division" so I aliased python -Qnew.  Too bad if this is something one
ought not to do, because it makes the best calculator that I know of. 
It does no good to put the future statement in a module listed in
PYTHONSTARTUP, because then, as you point out, the effect is limited
to that module.



On 4/30/06, Robert Kern <robert.kern at gmail.com> wrote:
> Eric Nodwell wrote:
> > Using the -Qnew switch with python breaks scipy (version 0.4.8 and
> > previous versions I have tested).
>
> Okay. So don't do that. I really don't think Python will be switching to the new
> division scheme in the 2.x series any more than it will switch to all-Unicode
> strings in that timeframe (-U). These options are for testing only, not deployment.
>
> > The lines below demonstrate this.  In summary, I run:
> > (1) python without -Q option, and without "from __future__ import
> > division".  This works.
> > (2) python without -Q option, and with "from __future__ import
> > division".  This works.
> > (2) python with the -Qnew option, and without "from __future__ import
> > division".  This breaks scipy.
>
> Note that "from __future__ import division" is a per-module setting. Executing
> it at the prompt only sets it in the __main__ module; it does not extend inside
> scipy or any other imported module.
>
> --
> Robert Kern
> robert.kern at gmail.com
>
> "I have come to believe that the whole world is an enigma, a harmless enigma
>  that is made terrible by our own mad attempt to interpret it as though it had
>  an underlying truth."
>   -- Umberto Eco
>
> _______________________________________________
> Scipy-dev mailing list
> Scipy-dev at scipy.net
> http://www.scipy.net/mailman/listinfo/scipy-dev
>




More information about the Scipy-dev mailing list