◐ Shell
reader mode source ↗
Skip to content

gh-107603: Argument Clinic can emit includes#108486

Merged
vstinner merged 3 commits into
python:mainfrom
vstinner:clinic_includes
Aug 25, 2023
Merged

gh-107603: Argument Clinic can emit includes#108486
vstinner merged 3 commits into
python:mainfrom
vstinner:clinic_includes

Conversation

@vstinner

@vstinner vstinner commented Aug 25, 2023

Copy link
Copy Markdown
Member

Remove _PyLong_UnsignedShort_Converter() from the public C API: move the function to the internal pycore_long.h header.

  • Add Clinic.add_include() method
  • Add CConverter.include and CConverter.add_include()
  • Printer.print_block() gets a second parameter: clinic.

@vstinner

Copy link
Copy Markdown
Member Author

cc @erlend-aasland @AlexWaygood

I included _PyLong_UnsignedShort_Converter() removal in this PR to show how the feature can be used, but once reviewed, I can consider to extract this change into a separated PR.

* Add Clinic.add_include() method
* Add CConverter.include and CConverter.add_include()
* Printer.print_block() gets a second parameter: clinic.
* Remove duplicated declaration of "clinic" global variable.
Always require clinic.
@vstinner

Copy link
Copy Markdown
Member Author

I rebased my PR on top of the merge AC change adding support for the limited C API.

@vstinner vstinner merged commit 73d33c1 into python:main Aug 25, 2023
@vstinner vstinner deleted the clinic_includes branch August 25, 2023 22:01
@vstinner

Copy link
Copy Markdown
Member Author

As a follow-up, I wrote PR #108499 which removes private _PyLong converters from the public C API: move them to the internal C API. The change adds #include "pycore_include.h" to the few clinic files using it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants