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

Guilherme Polo ggpolo at gmail.com
Sat Sep 20 14:34:57 EDT 2008


On Sat, Sep 20, 2008 at 1:27 PM, Mensanator <mensanator 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.

>
> 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



More information about the Python-list mailing list