Here's something interesting: sympy crashes in Python 2.6 (Windows)

Mensanator mensanator at aol.com
Sat Sep 20 20:51:55 CEST 2008


On Sep 20, 1:34�pm, "Guilherme Polo" <ggp... at gmail.com> wrote:
> On Sat, Sep 20, 2008 at 1:27 PM, Mensanator <mensana... at aol.com> wrote:
> > Beacuse in 2.6, Python apparently has fixed a discrepency that existed
> > in previous versions.
>
> > In the IDLE that comes with 2.5, typing "as", to wit "import random as
> > ran",
> > the words "import" and "as" highlight in red, so you can't use them as
> > variable
> > names or you'll get a syntax error.
>
> > Ah, but you CAN use "as" for a variable: "for as in xrange(10): print
> > as"
> > works just fine, although it shouldn't.
>
> > Python 2.6 fixes this discrepency and now gives you a syntax error if
> > you
> > use "as" for a variable name.
>
> You should have noticed the warning you received in python 2.5 when
> using "as" as a name.

I'm not the one who wrote sympy, so I guess I'm not
the only one who didn't notice it.

If it's a well known problem, then sorry I wasted
your time.

The sympy people thought it was important and,
as not everyone uses sympy, I thought I was
performing a service to the community mentioning
it here.

Sheesh.

>
>
>
> > The upshot is code (such as sympy) written prior to 2.6 can crash now
> > due
> > to this fix if said code inadverntently used what should have been a
> > reserved
> > word.
>
> > I was able to fix the code for this "as" problem, but not the one that
> > came after. I've reported this and interested parties can visit the
> > sympy
> > page and check Issue 1115.
> > --
> >http://mail.python.org/mailman/listinfo/python-list
>
> --
> -- Guilherme H. Polo Goncalves- Hide quoted text -
>
> - Show quoted text -




More information about the Python-list mailing list