ast.parse
Irmen de Jong
irmen.NOSPAM at xs4all.nl
Mon Apr 9 08:43:13 EDT 2012
More information about the Python-list mailing list
Mon Apr 9 08:43:13 EDT 2012
- Previous message (by thread): ast.parse
- Next message (by thread): ast.parse
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 9-4-2012 13:53, Kiuhnm wrote: > Is it a known fact that ast.parse doesn't handle line continuations and some multi-line > expressions? > For instance, he doesn't like > for (x, > y) in each([1, > 2]): > print(1) > at all. > Is there a workaround besides "repairing" the code on the fly? > > Kiuhnm What Python version are you using and what is the exact error? It works fine here (Python 2.7.2): >>> import ast >>> code="""for (x, ... y) in each([1, ... 2]): ... print(1)""" >>> ast.parse(code) <_ast.Module object at 0x02418A10> Irmen
- Previous message (by thread): ast.parse
- Next message (by thread): ast.parse
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list