#380 reports a wrong syntax error for a conditional expression

closed-works-for-me
nobody
None
5
2008-03-14
2006-10-12
YF Tao
No

It reports "p = b[rk[i+1]] if i+1 < len(rk) else 0" as
a syntax error.

Here is my system:
Windows XP
Eclipse 3.2.1 (installed on c:\eclipse)
PyDev 1.2.4
project location (d:\workspace)

Discussion

  • Dobes V

    Dobes V - 2007-08-21

    Logged In: YES
    user_id=400635
    Originator: NO

    I had this problem also, but when I went to the project settings and changed the pydev python version to 2.5, it went away.

     
  • Dobes V

    Dobes V - 2007-08-21

    Logged In: YES
    user_id=400635
    Originator: NO

    I would suggest changing the error, however, to report "conditionals are only supported in python 2.5+, and your project is set to python 2.4 or lower".

     
  • Fabio Zadrozny

    Fabio Zadrozny - 2008-03-14
    • status: open --> closed-works-for-me
     
  • Fabio Zadrozny

    Fabio Zadrozny - 2008-03-14

    Logged In: YES
    user_id=617340
    Originator: NO

    Closing... if the project is marked as python 2.5 it works -- as python 2.4 does not have it, a syntax error is correctly shown in that case.