Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide strong reference version of API for PyWeakref_GetObject #112188

Closed
corona10 opened this issue Nov 17, 2023 · 3 comments
Closed

Provide strong reference version of API for PyWeakref_GetObject #112188

corona10 opened this issue Nov 17, 2023 · 3 comments

Comments

@corona10
Copy link
Member

corona10 commented Nov 17, 2023

PEP-703 explains the risky situation of borrowed reference API.
For working on #111926, I think that we should introduce a new API with strong reference that was named PyWeakref_FetchObject from the PEP.
But to follow the recent convention, the API name will be PyWeakref_GetObjectRef.

Since SC approved the PEP, there would be no issue with adding this API.
However I want to listen to opinions from a few core devs before working on the task.

@encukou @colesbury @vstinner

@colesbury
Copy link
Contributor

I think @vstinner already added PyWeakref_GetRef that returns a strong reference.

@corona10
Copy link
Member Author

I think @vstinner already added PyWeakref_GetRef that returns a strong reference.

Oh I see, then we close the issue.

@vstinner
Copy link
Member

I think @vstinner already added PyWeakref_GetRef that returns a strong reference.

I'm living in the future! By the way, the beginning of my article https://vstinner.github.io/c-api-dict-getitemref.html tells about this API :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants