-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
gh-107603: Argument Clinic: Only include pycore_gc.h if needed #108726
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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
e89f507
Compare
@AlexWaygood: Please review my updated PR. I addressed your latest review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
In general, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I also don't like to pass around
clinic
like 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!
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: