Uh oh!
There was an error while loading. Please reload this page.
gh-107603: Argument Clinic: Only include pycore_gc.h if needed - #108726
Conversation
Argument Clinic now only includes pycore_gc.h if PyGC_Head is needed, and only includes pycore_runtime.h if _Py_ID() is needed. * Add 'condition' optional argument to Clinic.add_include(). * deprecate_keyword_use() includes pycore_runtime.h when using the _PyID() function. * Fix rendering of includes: comments start at the column 35. * Mark PC/clinic/_wmimodule.cpp.h and "Objects/stringlib/clinic/*.h.h" header files as generated in .gitattributes. Effects: * 42 header files generated by AC no longer include the internal C API, instead of 4 header files before. For example, Modules/clinic/_abc.c.h no longer includes the internal C API. * Fix _testclinic_depr.c.h: it now always includes pycore_runtime.h to get _Py_ID().
f75136c to
e89f507CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
vstinner
commented
Aug 31, 2023
@AlexWaygood: Please review my updated PR. I addressed your latest review. |
erlend-aasland
left a comment
There was a problem hiding this comment.
I also don't like to pass around clinic like that, but if Alex is fine with it, it's ok.
It is nice to avoid unneeded includes, so thanks for that clean-up.
vstinner
commented
Aug 31, 2023
In general, |
There was a problem hiding this comment.
LGTM
I also don't like to pass around
cliniclike that
Yeah, agreed that this maybe isn't the best pattern, but we can always refactor at a later date — I think this is fine for now.
Thanks for the updates @vstinner!
vstinner
commented
Aug 31, 2023
Merged, thanks for reviews @AlexWaygood and @erlend-aasland! |
Argument Clinic now only includes pycore_gc.h if PyGC_Head is needed, and only includes pycore_runtime.h if _Py_ID() is needed.
Effects: