Skip to content

Use different colour for 'Return value: Borrowed reference'#188

Merged
hugovk merged 2 commits intopython:mainfrom
hugovk:refcount-return-borrowed-ref
Apr 26, 2024
Merged

Use different colour for 'Return value: Borrowed reference'#188
hugovk merged 2 commits intopython:mainfrom
hugovk:refcount-return-borrowed-ref

Conversation

@hugovk
Copy link
Copy Markdown
Member

@hugovk hugovk commented Apr 17, 2024

Follow on from python/cpython#117926.

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

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.

This PR uses the same yellow/orange colour as the "Changed in version x.y" text in #185 - I've already checked the contrast ratios in that PR and both meet WCAG AAA. By using the same colour, it will be easier to check/change when we audit.

image image

For example: https://python-docs-theme-previews--188.org.readthedocs.build/en/188/c-api/exceptions.html#querying-the-error-indicator

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants