-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Closed as not planned
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)topic-C-APItype-featureA feature request or enhancementA feature request or enhancement
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
Metadata
Metadata
Assignees
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)topic-C-APItype-featureA feature request or enhancementA feature request or enhancement