bpo-38870: Expose a function to unparse an ast object in the ast module#17302
bpo-38870: Expose a function to unparse an ast object in the ast module#17302pablogsal merged 15 commits intopython:masterfrom
Conversation
|
CC: @isidentical |
|
I'm not sure if this is the right place to discuss API issues but if it isn't, I can submit a PR with these fixes to discuss. |
| basepath = (pathlib.Path(__file__).parent / ".." / "..").resolve() | ||
| test_dir = os.path.join(basepath, d) | ||
| for n in os.listdir(test_dir): | ||
| for n in os.listdir(test_dir): |
There was a problem hiding this comment.
IMHO using sole pathlib would be a good addition instead of mixing os.path and pathlib
There was a problem hiding this comment.
I agree, will change this soon
92fb117 to
0b39840
Compare
663696f to
ba425c1
Compare
…e can give preceding information for traverse
bd67c2b to
e158d34
Compare
ilevkivskyi
left a comment
There was a problem hiding this comment.
Thanks, looks good! IIUC the discussed improvements will be added in separate PRs.
|
Thanks @ilevkivskyi for reviews |
…le (pythonGH-17302) Add ast.unparse() as a function in the ast module that can be used to unparse an ast.AST object and produce a string with code that would produce an equivalent ast.AST object when parsed.
|
Running Zac-HD/hypothesmith@98d6a7c for a while doesn't find any cases where |
Thanks for telling us, @Zac-HD :) |
|
I mention it because lib2to3 and tokenize both fail to round-trip for certain weird edge cases! |
…le (pythonGH-17302) Add ast.unparse() as a function in the ast module that can be used to unparse an ast.AST object and produce a string with code that would produce an equivalent ast.AST object when parsed.
https://bugs.python.org/issue38870