Sorry, something went wrong.
| static int | ||
| symtable_init_stentry_type(PyObject *m) | ||
| { | ||
| return PyType_Ready(&PySTEntry_Type); |
There was a problem hiding this comment.
I don't see the value of having two exec slots. Why not simply putting all exec code into a single function?
Sorry, something went wrong.
There was a problem hiding this comment.
They do different things. Also PySTEntry_Type is define somewhere else and we might want to move the type initialization when the PySTEntry_Type is refactored.
Sorry, something went wrong.
|
|
||
| static int | ||
| symtable_init_constants(PyObject *m) | ||
| { |
There was a problem hiding this comment.
I'm trying to slowly use macros to factorize the code, something like:
A more generic machinery like the one you proposed would avoid such macro, and until there is such API, IMO using a macro makes the code more readable:
You can add a second macro for PyModule_AddIntConstant() calls.
Sorry, something went wrong.
There was a problem hiding this comment.
I'd rather not spend more time then necessary. This was a simple search and replace job.
Let's consider refactoring after PyModuleConstants_Def from #23286 has landed. The new feature will make module constant definitions easier.
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM.
Sorry, something went wrong.
Signed-off-by: Christian Heimes christian@python.org
https://bugs.python.org/issue1635741
Automerge-Triggered-By: GH:tiran