What if you could refactor your entire code base, safely and automatically? How much old code could you fix or replace if you didn't worry about updating every reference by hand? I'll show you how a concrete syntax tree (CST) can help you do just that using only the standard Python library.
Python includes a concrete syntax tree (CST) in the standard library, useful for mass refactoring code bases of all sizes. I'll walk through the differences between abstract and concrete syntax trees (AST and CST), why a CST is useful for refactoring, and how you can build basic refactoring tools on top of a CST to modify your entire code base quickly and safely. Lastly, I'll demonstrate what's possible with these tools, including upgrading code to new interfaces, or wholesale movement of code between modules. This talk assumes a basic understanding of how Python works, but will otherwise provide enough context to be useful to those who haven't previously worked with syntax trees.