Going from an AST to a PEP8-formatted Python file #2384
Unanswered
bogdanstate
asked this question in
Q&A
Replies: 2 comments 1 reply
-
Thought about this some more, and I guess writing a "reverse parser" for the AST is rather trivial. That + something like |
Beta Was this translation helpful? Give feedback.
1 reply
-
If you were in the business of implementing this yourself, there's logic you can follow from astor: https://github.com/berkerpeksag/astor/blob/master/astor/code_gen.py |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
This is a bit of an unusual use case, but I am trying to generate some human-readable Python code from Rust. I am interested just in having syntactically valid code for the time being, so compilation is not a concern.
Is there any project currently that allows one to format a rustpython AST to a PEP8-compliant file? I have done some digging around the code base here, but I can't seem to find anything to answer this use case. Any pointers much appreciated (as would be confirmation that this functionality is not supported)!
Beta Was this translation helpful? Give feedback.
All reactions