-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
gh-136823: Update documentation on excluded headers in Python.h #136824
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
base: main
Are you sure you want to change the base?
gh-136823: Update documentation on excluded headers in Python.h #136824
Conversation
Hi @AA-Turner, could you please take a look at this PR? |
Doc/extending/extending.rst
Outdated
``PY``, except those defined in standard header files. | ||
|
||
Note that :file:`Python.h` excludes ``<stdio.h>``, ``<string.h>``, ``<errno.h>``, and ``<stdlib.h>`` as they are not used by | ||
Python anymore. For backward compatibility of existing third party C extensions, they will |
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.
Should we write down since which version they are no longer used, as we did for <ctype.h>
and <unistd.h>
?
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.
Seems like the right thing to do, but I couldn't find since which version they are no longer used. @vstinner, you seem to have added that comment to the code 4 years ago. Do you happen to know since which version?
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've looked into the different versions. Python 3.10 was indeed the last version of Python that was importing these headers. From Python 3.11 onward, it became conditional.
@ilovelinux, could you please re-review this PR? I believe that with the new changes (as suggested by Sergey), the documentation is now in sync with the actual implementation.
This part of the documentation from https://docs.python.org/3/extending/extending.html#a-simple-example is currently outdated:
This PR aligns the documentation with the code and the comments provided by the original author that implemented the changes.
📚 Documentation preview 📚: https://cpython-previews--136824.org.readthedocs.build/