Open davidhewitt opened 1 year ago
What's the use case for PyAny::get_refcnt
? Perhaps it should be deprecated in favor of methods with narrower semantics.
I might even suggest it doesn't need a replacement added immediately, we can let users call pyo3::ffi::Py_REFCNT(obj.as_ptr())
to get the same functionality for now and if someone comes up with a desirable proposal for a safe API we could add that then?
Labelling as "Good First Issue" as all that's really needed is to remove or deprecate .get_refcnt()
methods.
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?