-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
Docs: Add classes to C API return value annotations #117926
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
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.
👍
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.
Looks good
Co-authored-by: Nikita Sobolev <[email protected]>
Thanks @hugovk for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12. |
(cherry picked from commit 3284b84) Co-authored-by: Hugo van Kemenade <[email protected]> Co-authored-by: Nikita Sobolev <[email protected]>
GH-117937 is a backport of this pull request to the 3.12 branch. |
#117937) Docs: Add classes to C API return value annotations (GH-117926) (cherry picked from commit 3284b84) Co-authored-by: Hugo van Kemenade <[email protected]> Co-authored-by: Nikita Sobolev <[email protected]>
Co-authored-by: Nikita Sobolev <[email protected]>
Step two: python/python-docs-theme#188 |
Currently light green is used for all return types
For example: https://docs.python.org/3/c-api/exceptions.html
Screenshots
A borrowed reference is not necessarily a "bad" thing, but we may want to use something other than green that indicates it's "good", to indicate they should be treated with care.
One option is yellow.
These annotations are added in
Doc/tools/extensions/c_annotations.py
. The first step is to add CSS classes in this file.The light green colour is defined in https://github.com/python/python-docs-theme. The second step is to adjust the colours in the theme.
This PR also includes some light cleanup whilst we're touching this file, see commits.
📚 Documentation preview 📚: https://cpython-previews--117926.org.readthedocs.build/