FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-105927: PyWeakref_GetRef() returns 1 on success by vstinner · Pull Request #106561 · python/cpython · GitHub

/ cpython Public

gh-105927: PyWeakref_GetRef() returns 1 on success - #106561

Merged
vstinner merged 2 commits into
python:mainfrom
vstinner:weakref_getref_success
Jul 9, 2023
Merged

gh-105927: PyWeakref_GetRef() returns 1 on success#106561
vstinner merged 2 commits into
python:mainfrom
vstinner:weakref_getref_success

Conversation

vstinner commented Jul 9, 2023
edited by github-actions Bot
Loading

Copy link
Copy Markdown
Member

PyWeakref_GetRef() now returns 1 on success, and return 0 if the reference is dead.


📚 Documentation preview 📚: https://cpython-previews--106561.org.readthedocs.build/

PyWeakref_GetRef() now returns 1 on success, and return 0 if the
reference is dead.

vstinner commented Jul 9, 2023

Copy link
Copy Markdown
Member Author

PR to update the newly added C API to respect the new C API guidelines: https://devguide.python.org/developer-workflow/c-api/index.html

APIs with lesser and greater results must return 0 for the lesser result, and 1 for the greater result. Consider a lookup function with a three-way return: (...)

cc @erlend-aasland

vstinner commented Jul 9, 2023

Copy link
Copy Markdown
Member Author

cc @encukou

Comment thread Objects/weakrefobject.c Outdated
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
vstinner enabled auto-merge (squash) July 9, 2023 15:29

vstinner commented Jul 9, 2023

Copy link
Copy Markdown
Member Author

Thanks for the review @serhiy-storchaka.

vstinner merged commit ee46cb6 into python:main Jul 9, 2023
vstinner deleted the weakref_getref_success branch July 9, 2023 16:10

vstinner commented Jul 9, 2023

Copy link
Copy Markdown
Member Author

I updated pythoncapi-compat: python/pythoncapi-compat@d000b55

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL