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

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

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 2 commits intopython:mainfromhugovk:refcount-return-borrowed-ref
Apr 26, 2024

Conversation

hugovk
Copy link
Member

@hugovkhugovk commentedApr 17, 2024
edited
Loading

Follow on frompython/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.

imageimage

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

@vstinner
Copy link
Member

This PR uses the same yellow/orange colour as the "Changed in version x.y" text in#185

FYI As a color blind person, I don't see the difference between "Borrowed reference" and "New reference" colors in thelight mode. Well, I'm also color blind, so my opinion may not matter :-)

In the dark mode, I see clearly that the two colors are very different.

erlend-aasland and hugovk reacted with heart emoji

@flying-sheep
Copy link

If you’re reusing existing colors, how about you centralize their definition as a CSS variables and then use it from both your new CSS rules and the old ones that originally defined the color?

erlend-aasland reacted with thumbs up emoji

@hugovk
Copy link
MemberAuthor

Good idea, shall we also replace the pale green for the other "Return value" with the "New in version" green?

image

The light mode ones are much closer, but we could replace one with the other here too?

image

@hugovk
Copy link
MemberAuthor

hugovk commentedApr 24, 2024
edited
Loading

Updated:

image

image

image

image

Suggestions for better variable names welcome :)

humitos, erlend-aasland, and flying-sheep reacted with heart emoji

Copy link

@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.

I don't have a strong opinion regarding naming, but I like the change! Personally, I would prefer borrowed references to be labelled as "bad", but that is a different discussion.

hugovk reacted with thumbs up emoji
@hugovkhugovk merged commit97952b5 intopython:mainApr 26, 2024
9 checks passed
@hugovkhugovk deleted the refcount-return-borrowed-ref branchApril 26, 2024 10:26
@hugovk
Copy link
MemberAuthor

This is now deployed:https://docs.python.org/3/c-api/exceptions.html

flying-sheep and erlend-aasland reacted with hooray emoji

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

@erlend-aaslanderlend-aaslanderlend-aasland approved these changes

@encukouencukouAwaiting requested review from encukou

@vstinnervstinnerAwaiting requested review from vstinner

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@hugovk@vstinner@flying-sheep@erlend-aasland

[8]ページ先頭

©2009-2025 Movatter.jp