Created
April 9, 2014 14:00
-
-
Save ibizaman/10273933 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> r = RedBaron("c = 2 = 1") | |
Traceback (most recent call last): | |
File "<stdin>", line 1, in <module> | |
File "/users/ppx/python/redbaron-master/redbaron.py", line 491, in __init__ | |
self.data = [to_node(x, parent=self, on_attribute="root") for x in baron.parse(source_code)] | |
File "/users/ppx/python/baron-master/baron/baron.py", line 41, in parse | |
print_function_finder.visit(python_ast_parse(source_code)) | |
File "/celestite/projects/cso-cpcc/Python/lib/python3.3/ast.py", line 35, in parse | |
return compile(source, filename, mode, PyCF_ONLY_AST) | |
File "<unknown>", line 1 | |
SyntaxError: can't assign to literal | |
>>> r = RedBaron("c = 1") | |
>>> r[0].target = "c = 2" | |
>>> r.dumps() | |
'c = 2 = 1' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment