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

Mensanator mensanator at aol.com
Sat Sep 20 12:27:10 EDT 2008


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.

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.



More information about the Python-list mailing list