Skip to content

Conversation

@vstinner
Copy link
Member

@vstinnervstinner commented Jul 9, 2023

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
Copy link
MemberAuthor

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
Copy link
MemberAuthor

cc @encukou

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@vstinnervstinner enabled auto-merge (squash) July 9, 2023 15:29
@vstinner
Copy link
MemberAuthor

Thanks for the review @serhiy-storchaka.

@vstinnervstinner merged commit ee46cb6 into python:mainJul 9, 2023
@vstinnervstinner deleted the weakref_getref_success branch July 9, 2023 16:10
@vstinner
Copy link
MemberAuthor

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

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@vstinner@serhiy-storchaka@bedevere-bot