This is a cool overview, and I certainly learned new things about the Python language from it. Thanks for posting!<p>We do lots of Python metaprogramming at Mito [1], but generally avoid all of this fancy Python fluff to get it done. Specifically, we avoid metaclasses, invisible decorators, etc. Instead, we take a much simpler approach of having Python code that literally populates as template .py file, and then writes it to the correct location in our codebase.<p>As a concrete example: we’re a spreadsheet, so we let our users transform data in a bunch of different ways - adding a column, writing a formula, deleting some rows. Anytime I want to add a new transform (say, encoding a column), I tell the metaprogramming package “python -m metaprogramming step —name “Encoding A Column”. It will ask me some questions about the parameters and types of those parameters, and then write most of the 4-6 boilerplate Python and Typescript files I need automatically! You can see it here [2].<p>This is still metaprogramming (it’s certainly code that writes code). But the code you end up with at the end of the day is very simple Python code that is extremely easy to understand / maintain long-term.<p>I’ll pass on the fancy stuff for now. Thanks though!<p>[1] <a href="https://trymito.io" rel="nofollow">https://trymito.io</a><p>[2] <a href="https://github.com/mito-ds/monorepo/blob/dev/mitosheet/dev/create_new_step.py" rel="nofollow">https://github.com/mito-ds/monorepo/blob/dev/mitosheet/dev/c...</a>