Open
Description
Is there a public API that allows me to check whether an object is weakly referenceable? I know that you can check the value of the tp_weaklistoffset
slot or check for the Py_TPFLAGS_MANAGED_WEAKREF
flag to get the answer, but what about having something like:
PyObject_WeaklyReferenceable
orPyWeakref_Referenceable
or whatever name fits the situation? This would encapsulate things and keep the extension module developer away from the internal stuff.
https://discuss.python.org/t/weakly-referencable-object/80248