PyWeakReference

PyWeakReference is the base struct for the Python ReferenceType, ProxyType, and CallableProxyType.

subclass of PyObject

Members

Variables

hash
Py_hash_t hash;

A cache for wr_object's hash code. As usual for hashes, this is -1 if the hash code isn't known yet.

wr_callback
PyObject* wr_callback;

A callable to invoke when wr_object dies, or NULL if none.

wr_next
PyWeakReference* wr_next;

If wr_object is weakly referenced, wr_object has a doubly-linked NULL- terminated list of weak references to it. These are the list pointers. If wr_object goes away, wr_object is set to Py_None, and these pointers have no meaning then.

wr_object
PyObject* wr_object;

The object to which this is a weak reference, or Py_None if none. Note that this is a stealth reference: wr_object's refcount is not incremented to reflect this pointer.

wr_prev
PyWeakReference* wr_prev;

If wr_object is weakly referenced, wr_object has a doubly-linked NULL- terminated list of weak references to it. These are the list pointers. If wr_object goes away, wr_object is set to Py_None, and these pointers have no meaning then.

Meta