Files
typthon/Include/weakrefobject.h
copilot-swe-agent[bot] b198f511d2 Rename Py_ to Ty_ throughout C API
Massive automated renaming of all Py_/PyObject/etc. prefixes to Ty_/TyObject/etc.
This includes:
- All public API types (TyObject, TyTypeObject, etc.)
- All public API functions (Ty_Initialize, Ty_BuildValue, etc.)
- All internal API (_Ty_ prefixes)
- Reference counting macros (Ty_INCREF, Ty_DECREF, etc.)
- Type flags (Ty_TPFLAGS_*)
- Debug flags (Ty_DEBUG, Ty_TRACE_REFS, etc.)
- All object type APIs (TyList_, TyDict_, TyUnicode_, etc.)

This changes over 60,000 occurrences across 1000+ files.

Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
2025-12-29 17:37:49 +00:00

47 lines
1.4 KiB
C

/* Weak references objects for Python. */
#ifndef Ty_WEAKREFOBJECT_H
#define Ty_WEAKREFOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
typedef struct _PyWeakReference PyWeakReference;
PyAPI_DATA(TyTypeObject) _TyWeakref_RefType;
PyAPI_DATA(TyTypeObject) _TyWeakref_ProxyType;
PyAPI_DATA(TyTypeObject) _TyWeakref_CallableProxyType;
#define PyWeakref_CheckRef(op) PyObject_TypeCheck((op), &_TyWeakref_RefType)
#define PyWeakref_CheckRefExact(op) \
Ty_IS_TYPE((op), &_TyWeakref_RefType)
#define PyWeakref_CheckProxy(op) \
(Ty_IS_TYPE((op), &_TyWeakref_ProxyType) \
|| Ty_IS_TYPE((op), &_TyWeakref_CallableProxyType))
#define PyWeakref_Check(op) \
(PyWeakref_CheckRef(op) || PyWeakref_CheckProxy(op))
PyAPI_FUNC(TyObject *) PyWeakref_NewRef(TyObject *ob,
TyObject *callback);
PyAPI_FUNC(TyObject *) PyWeakref_NewProxy(TyObject *ob,
TyObject *callback);
Ty_DEPRECATED(3.13) PyAPI_FUNC(TyObject *) PyWeakref_GetObject(TyObject *ref);
#if !defined(Ty_LIMITED_API) || Ty_LIMITED_API+0 >= 0x030D0000
PyAPI_FUNC(int) PyWeakref_GetRef(TyObject *ref, TyObject **pobj);
#endif
#ifndef Ty_LIMITED_API
# define Ty_CPYTHON_WEAKREFOBJECT_H
# include "cpython/weakrefobject.h"
# undef Ty_CPYTHON_WEAKREFOBJECT_H
#endif
#ifdef __cplusplus
}
#endif
#endif /* !Ty_WEAKREFOBJECT_H */