3 #ifndef Py_WEAKREFOBJECT_H
4 #define Py_WEAKREFOBJECT_H
45 #define PyWeakref_CheckRef(op) PyObject_TypeCheck(op, &_PyWeakref_RefType)
46 #define PyWeakref_CheckRefExact(op) \
47 (Py_TYPE(op) == &_PyWeakref_RefType)
48 #define PyWeakref_CheckProxy(op) \
49 ((Py_TYPE(op) == &_PyWeakref_ProxyType) || \
50 (Py_TYPE(op) == &_PyWeakref_CallableProxyType))
52 #define PyWeakref_Check(op) \
53 (PyWeakref_CheckRef(op) || PyWeakref_CheckProxy(op))
73 #define PyWeakref_GET_OBJECT(ref) \
74 (Py_REFCNT(((PyWeakReference *)(ref))->wr_object) > 0 \
75 ? ((PyWeakReference *)(ref))->wr_object \