Export to GitHub

lagrange - issue #2

Python 2.6 keyword 'as' used as variable name


Posted on Jul 20, 2009 by Helpful Wombat

Running under python 2.6 produces the error

File "/work/lagrange/ratemodel.py", line 273 as = Ancsplit(self, dist, split, weight=weight) ^ SyntaxError: invalid syntax

This is because 'as' is a keyword in Python 2.6.

In the current snapshot, there is a file decmodel_mp.py which has the same problem.

Comment #1

Posted on Jul 27, 2009 by Happy Cat

I a new user of lagrange and I was trying to play a little bit with the example files (psychotria_demo.lagrange.py) in the website and I have the same problem. How can I solve this problem and have lagrange working?

Comment #2

Posted on Sep 22, 2009 by Helpful Wombat

Just open the file with a text editor, search for and replace all occurences of 'as' with something else like 'anc_split'.

Comment #3

Posted on Sep 1, 2010 by Massive Hippo

(No comment was entered for this change.)

Comment #4

Posted on Sep 1, 2010 by Massive Hippo

that is correct. this is fixed in the newer version, but moving to c++ (faster code, so no longer an issue)

Status: Accepted

Labels:
Type-Defect Priority-Medium