Argument-Clinic / cpython

The Python programming language
https://www.python.org/
Other
1 stars 0 forks source link

Slot support #38

Open erlend-aasland opened 9 months ago

erlend-aasland commented 9 months ago

Here are some thoughts from the top of my head: Currently, Argument Clinic produce normalised PyMethod_Def entries[^1]. We structure the parsed "function" data in Function and Parameter classes, and the C code generation is done via the CLanguage class. Recently, we also added support for getters and setters (PyGetSet_Def). Because of tp_init, tp_new and getters/setters, we now have a lot of special cases for all code that interacts with Function objects. Perhaps it is time to break up Function:

We also may want to break up the code generation; output_templates and render_function has been refactor targets for a long time (they account for a very large percentage of clinic.py). @AlexWaygood and I did some small refactorings last year, and we've been trying out some ideas. One possibility, is to have multiple generator classes.

[^1]: except for __init__ and __new__ slots