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
Refcounting changes after PEP 683 #3357
Comments
What's the use case for |
I might even suggest it doesn't need a replacement added immediately, we can let users call |
Labelling as "Good First Issue" as all that's really needed is to remove or deprecate |
This is an attempt to fix PyO3#3357. The function is used relatively frequently in tests, so have left it with #[cfg(test)] and pub(crate). This avoids coating the tests with `unsafe`, and something that doesn't indicate intent as well. TODO: [ ] Fix docs that refer to `get_refcnt` as an example - is there another function I can use instead?
This is an attempt to fix PyO3#3357. The function is used relatively frequently in tests, so have left it with #[cfg(test)] and pub(crate). This avoids coating the tests with `unsafe`, and something that doesn't indicate intent as well. TODO: [ ] Fix docs that refer to `get_refcnt` as an example - is there another function I can use instead?
PEP 683's "immortal objects" changed the meaning of reference counts; immortal objects have a fixed refcount value which never changes.
Further, the PEP states:
Does this mean that
PyAny::get_refcnt
should change, given that the upstream position is essentially that only 0 and 1 have meaning?The text was updated successfully, but these errors were encountered: