Parse a .py file, read the AST, modify it, then write back the modified source code
Become part of the top 3% of the developers by applying to Toptal https://topt.al/25cXVn
--
Music by Eric Matyas
https://www.soundimage.org
Track title: Hypnotic Puzzle3
--
Chapters
00:00 Question
00:59 Accepted answer (Score 84)
02:07 Answer 2 (Score 62)
02:59 Answer 3 (Score 41)
03:24 Answer 4 (Score 20)
03:49 Thank you
--
Full question
https://stackoverflow.com/questions/7686...
Question links:
[AST]: http://en.wikipedia.org/wiki/Abstract_sy...
[ast]: http://docs.python.org/library/ast.html
[compiler]: http://docs.python.org/library/compiler....
[Mutation testing library]: http://en.wikipedia.org/wiki/Mutation_te...
Accepted answer links:
[Pythoscope]: https://github.com/mkwiatkowski/pythosco...
[2to3]: http://docs.python.org/library/2to3.html
[lib2to3]: http://svn.python.org/projects/python/tr.../
[rope project]: https://github.com/python-rope/rope
[ast]: http://docs.python.org/library/ast.html
[there's an older example of how to "unparse" syntax trees back into code]: https://svn.python.org/projects/python/t...
[redbaron]: https://redbaron.readthedocs.org/en/late.../
Answer 2 links:
[codegen]: https://pypi.python.org/pypi/codegen/1.0
Answer 3 links:
https://docs.python.org/3.9/whatsnew/3.9...
https://docs.python.org/3.9/library/ast....
Answer 4 links:
[astunparse]: https://github.com/simonpercivall/astunp...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#python #compilerconstruction #abstractsyntaxtree
#avk47
--
Music by Eric Matyas
https://www.soundimage.org
Track title: Hypnotic Puzzle3
--
Chapters
00:00 Question
00:59 Accepted answer (Score 84)
02:07 Answer 2 (Score 62)
02:59 Answer 3 (Score 41)
03:24 Answer 4 (Score 20)
03:49 Thank you
--
Full question
https://stackoverflow.com/questions/7686...
Question links:
[AST]: http://en.wikipedia.org/wiki/Abstract_sy...
[ast]: http://docs.python.org/library/ast.html
[compiler]: http://docs.python.org/library/compiler....
[Mutation testing library]: http://en.wikipedia.org/wiki/Mutation_te...
Accepted answer links:
[Pythoscope]: https://github.com/mkwiatkowski/pythosco...
[2to3]: http://docs.python.org/library/2to3.html
[lib2to3]: http://svn.python.org/projects/python/tr.../
[rope project]: https://github.com/python-rope/rope
[ast]: http://docs.python.org/library/ast.html
[there's an older example of how to "unparse" syntax trees back into code]: https://svn.python.org/projects/python/t...
[redbaron]: https://redbaron.readthedocs.org/en/late.../
Answer 2 links:
[codegen]: https://pypi.python.org/pypi/codegen/1.0
Answer 3 links:
https://docs.python.org/3.9/whatsnew/3.9...
https://docs.python.org/3.9/library/ast....
Answer 4 links:
[astunparse]: https://github.com/simonpercivall/astunp...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#python #compilerconstruction #abstractsyntaxtree
#avk47