-
-
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?
Doc/extending/extending.rst
Outdated
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 | ||
be included if Py_LIMITED_API is not defined and for limited C API version 3.10 and older. | ||
The ``<ctype.h>`` and ``<unistd.h>`` headers are also not included for limited C API version 3.13 and newer. |
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.
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 | |
be included if Py_LIMITED_API is not defined and for limited C API version 3.10 and older. | |
The ``<ctype.h>`` and ``<unistd.h>`` headers are also not included for limited C API version 3.13 and newer. | |
For backward compatibility of existing third party C extensions, :file:`Python.h` | |
includes ``<stdio.h>``, ``<string.h>``, ``<errno.h>``, and ``<stdlib.h>`` iff | |
:c:macro:`Py_LIMITED_API` is not defined or for limited C API version 3.10 and older. | |
The ``<ctype.h>`` and ``<unistd.h>`` headers are also not included for limited C API version 3.13 and newer. |
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/