Message3770

Author certik
Recipients certik
Date 2008-11-10.07:13:56
SpamBayes Score 1.1549483e-07
Marked as misclassified No
Message-id <1226301237.7.0.526270472296.issue1168@psf.upfronthosting.co.za>
In-reply-to
Content
This now works. Thanks for the fix!

Now try to add this line at the end of the script:

print parse_expr("Integer(3)", {})

and run it:

$ python2.6 ast_test.py 
<__main__.Integer object at 0xb7ba092c>
<__main__.Div object at 0xb7ba0b6c>
<__main__.Mul object at 0xb7ba0bac>
<__main__.Integer object at 0xb7ba0a6c>
$ jython ast_test.py 
<__main__.Integer object at 1>
<__main__.Div object at 2>
<__main__.Mul object at 3>
Traceback (most recent call last):
  File "ast_test.py", line 82, in <module>
    print parse_expr("Integer(3)", {})
  File "ast_test.py", line 75, in parse_expr
    a = Transform(local_dict, global_dict).visit(a)
  File "/home/ondra/repos/jython/dist/Lib/ast.py", line 256, in visit
    return visitor(node)
  File "/home/ondra/repos/jython/dist/Lib/ast.py", line 321, in
generic_visit
    new_node = self.visit(old_value)
  File "/home/ondra/repos/jython/dist/Lib/ast.py", line 256, in visit
    return visitor(node)
  File "/home/ondra/repos/jython/dist/Lib/ast.py", line 319, in
generic_visit
    old_value[:] = new_values
TypeError: can only assign array (not "list") to array slice


And there will probably be couple more. I'll try to isolate it.
History
Date User Action Args
2008-11-10 07:13:57certiksetmessageid: <1226301237.7.0.526270472296.issue1168@psf.upfronthosting.co.za>
2008-11-10 07:13:57certiksetrecipients: + certik
2008-11-10 07:13:57certiklinkissue1168 messages
2008-11-10 07:13:57certikcreate