Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
hugovk merged 5 commits intopython:mainfromhugovk:docs-c-api-return-value-classes
Apr 16, 2024

Conversation

hugovk
Copy link
Member

@hugovkhugovk commentedApr 16, 2024
edited
Loading

Currently light green is used for all return types

  • "Return value: Always NULL."
  • "Return value: New reference."
  • "Return value: Borrowed reference."

For example:https://docs.python.org/3/c-api/exceptions.html

Screenshots

image

image

image

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.

  1. These annotations are added inDoc/tools/extensions/c_annotations.py. The first step is to add CSS classes in this file.

  2. The light green colour is defined inhttps://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/

erlend-aasland reacted with rocket emoji
@hugovkhugovk added skip issue skip news docsDocumentation in the Doc dir labelsApr 16, 2024
Copy link
Member

@sobolevnsobolevn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

👍

Copy link
Contributor

@erlend-aaslanderlend-aasland left a 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 <mail@sobolevn.me>
@hugovkhugovkenabled auto-merge (squash)April 16, 2024 15:44
@hugovkhugovk merged commit3284b84 intopython:mainApr 16, 2024
@hugovkhugovk deleted the docs-c-api-return-value-classes branchApril 16, 2024 15:56
@miss-islington-app
Copy link

Thanks@hugovk for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestApr 16, 2024
(cherry picked from commit3284b84)Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
@bedevere-app
Copy link

GH-117937 is a backport of this pull request to the3.12 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.12only security fixes labelApr 16, 2024
hugovk added a commit that referenced this pull requestApr 16, 2024
#117937)Docs: Add classes to C API return value annotations (GH-117926)(cherry picked from commit3284b84)Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
diegorusso pushed a commit to diegorusso/cpython that referenced this pull requestApr 17, 2024
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
@hugovk
Copy link
MemberAuthor

Step two:python/python-docs-theme#188

erlend-aasland reacted with rocket emoji

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

@sobolevnsobolevnsobolevn approved these changes

@erlend-aaslanderlend-aaslanderlend-aasland approved these changes

Assignees
No one assigned
Labels
docsDocumentation in the Doc dirskip issueskip news
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@hugovk@sobolevn@erlend-aasland

[8]ページ先頭

©2009-2025 Movatter.jp