Skip to content

Weakly Referenceable Object #130062

Open
Open
@nybblista

Description

@nybblista

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 or
  • PyWeakref_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

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)pendingThe issue will be closed if no feedback is providedtopic-C-APItype-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions