Message7780

Author amak
Recipients amak, dturanski, fwierzbicki
Date 2013-02-26.00:29:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1361838593.38.0.808174331978.issue1798@psf.upfronthosting.co.za>
In-reply-to
Content
We need to be able to differentiate between statements and expressions before deciding whether to call "eval" or "exec" on the jython intepreter.

The ast.parse() function might be one way to do it

Jython 2.7b1+ (default:a30708945630, Feb 23 2013, 15:22:29)
[Java HotSpot(TM) Client VM (Sun Microsystems Inc.)] on java1.6.0_41
Type "help", "copyright", "credits" or "license" for more information.
>>> import ast
>>> ast.parse("x=7").body
[Assign]
>>> ast.parse("7").body
[Expr]
>>>
History
Date User Action Args
2013-02-26 00:29:53amaksetmessageid: <1361838593.38.0.808174331978.issue1798@psf.upfronthosting.co.za>
2013-02-26 00:29:53amaksetrecipients: + amak, fwierzbicki, dturanski
2013-02-26 00:29:53amaklinkissue1798 messages
2013-02-26 00:29:53amakcreate