Serhiy Storchaka added the comment:

If someone wants to parse a simple expression that may be a string he should 
use the "eval" mode.

>>> ast.dump(ast.parse("'test'"))
"Module(body=[], docstring='test')"
>>> ast.dump(ast.parse("'test'", mode='eval'))
"Expression(body=Str(s='test'))"

----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue29646>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to