A Question about Code Generation

6 views
Skip to first unread message

Andrew Frances

unread,
Jul 28, 2021, 11:35:20 AM7/28/21
to montrealpython
Hi Montreal Pythonistas:

I have a code base - Python 3 but no type annotations that I am constantly adding functionality. The changes involve generating files and adding methods. This is time consuming.

I was thinking of writing a YAML file describing the changes. Then have a tool analyze the code, make the changes and generate the modified files (or overwrite them).

An example of a change, may be analyzing conditionals and adding another branch (yes I could create a faster dispatch table but that is another story).

However feasible would this be with the AST package?

Cheers,
Andrew
Reply all
Reply to author
Forward
0 new messages