/opt/imh/python3.13/include/python3.13/cpython
NameSizeModeActions
abstract.h33990644editdlrm
bytearrayobject.h11630644editdlrm
bytesobject.h11800644editdlrm
cellobject.h10760644editdlrm
ceval.h11150644editdlrm
classobject.h22450644editdlrm
code.h152070644editdlrm
compile.h21210644editdlrm
complexobject.h9090644editdlrm
context.h18370644editdlrm
critical_section.h55880644editdlrm
descrobject.h15930644editdlrm
dictobject.h38700644editdlrm
fileobject.h6520644editdlrm
fileutils.h2320644editdlrm
floatobject.h9000644editdlrm
frameobject.h11990644editdlrm
funcobject.h70490644editdlrm
genobject.h29970644editdlrm
import.h7250644editdlrm
initconfig.h81970644editdlrm
listobject.h18010644editdlrm
lock.h17630644editdlrm
longintrepr.h51190644editdlrm
longobject.h55830644editdlrm
memoryobject.h22230644editdlrm
methodobject.h22760644editdlrm
modsupport.h10420644editdlrm
monitoring.h77040644editdlrm
object.h190740644editdlrm
objimpl.h38200644editdlrm
odictobject.h13110644editdlrm
picklebufobject.h8480644editdlrm
pthread_stubs.h39260644editdlrm
pyatomic.h165060644editdlrm
pyatomic_gcc.h191310644editdlrm
pyatomic_msc.h292410644editdlrm
pyatomic_std.h243360644editdlrm
pyctype.h13870644editdlrm
pydebug.h14130644editdlrm
pyerrors.h29080644editdlrm
pyfpe.h4440644editdlrm
pyframe.h19470644editdlrm
pyhash.h13820644editdlrm
pylifecycle.h28170644editdlrm
pymem.h28430644editdlrm
pystate.h94650644editdlrm
pystats.h54340644editdlrm
pythonrun.h43270644editdlrm
pythread.h15100644editdlrm
pytime.h7070644editdlrm
setobject.h20460644editdlrm
sysmodule.h7750644editdlrm
traceback.h2820644editdlrm
tracemalloc.h8230644editdlrm
tupleobject.h13290644editdlrm
unicodeobject.h250740644editdlrm
warnings.h6950644editdlrm
weakrefobject.h22490644editdlrm
Edit: /opt/imh/python3.13/include/python3.13/cpython/weakrefobject.h (2249B)
#ifndef Py_CPYTHON_WEAKREFOBJECT_H # error "this header file must not be included directly" #endif /* PyWeakReference is the base struct for the Python ReferenceType, ProxyType, * and CallableProxyType. */ struct _PyWeakReference { PyObject_HEAD /* 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. */ PyObject *wr_object; /* A callable to invoke when wr_object dies, or NULL if none. */ PyObject *wr_callback; /* A cache for wr_object's hash code. As usual for hashes, this is -1 * if the hash code isn't known yet. */ Py_hash_t hash; /* 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. */ PyWeakReference *wr_prev; PyWeakReference *wr_next; vectorcallfunc vectorcall; #ifdef Py_GIL_DISABLED /* Pointer to the lock used when clearing in free-threaded builds. * Normally this can be derived from wr_object, but in some cases we need * to lock after wr_object has been set to Py_None. */ PyMutex *weakrefs_lock; #endif }; PyAPI_FUNC(void) _PyWeakref_ClearRef(PyWeakReference *self); Py_DEPRECATED(3.13) static inline PyObject* PyWeakref_GET_OBJECT(PyObject *ref_obj) { PyWeakReference *ref; PyObject *obj; assert(PyWeakref_Check(ref_obj)); ref = _Py_CAST(PyWeakReference*, ref_obj); obj = ref->wr_object; // Explanation for the Py_REFCNT() check: when a weakref's target is part // of a long chain of deallocations which triggers the trashcan mechanism, // clearing the weakrefs can be delayed long after the target's refcount // has dropped to zero. In the meantime, code accessing the weakref will // be able to "see" the target object even though it is supposed to be // unreachable. See issue gh-60806. if (Py_REFCNT(obj) > 0) { return obj; } return Py_None; } #define PyWeakref_GET_OBJECT(ref) PyWeakref_GET_OBJECT(_PyObject_CAST(ref))