Tuesday 15 August 2023

Python AST with preserved comments

I can get AST without comments using

import ast
module = ast.parse(open('/path/to/module.py').read())

Could you show an example of getting AST with preserved comments (and whitespace)?



from Python AST with preserved comments

No comments:

Post a Comment