mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
gh-103509: PEP 697 -- Limited C API for Extending Opaque Types (GH-103511)
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net> Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
This commit is contained in:
parent
35d273825a
commit
cd9a56c2b0
30 changed files with 970 additions and 19 deletions
|
@ -355,6 +355,8 @@ PyAPI_FUNC(PyObject *) PyType_GetQualName(PyTypeObject *);
|
|||
#endif
|
||||
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030C0000
|
||||
PyAPI_FUNC(PyObject *) PyType_FromMetaclass(PyTypeObject*, PyObject*, PyType_Spec*, PyObject*);
|
||||
PyAPI_FUNC(void *) PyObject_GetTypeData(PyObject *obj, PyTypeObject *cls);
|
||||
PyAPI_FUNC(Py_ssize_t) PyType_GetTypeDataSize(PyTypeObject *cls);
|
||||
#endif
|
||||
|
||||
/* Generic type check */
|
||||
|
@ -521,6 +523,9 @@ given type object has a specified feature.
|
|||
// subject itself (rather than a mapped attribute on it):
|
||||
#define _Py_TPFLAGS_MATCH_SELF (1UL << 22)
|
||||
|
||||
/* Items (ob_size*tp_itemsize) are found at the end of an instance's memory */
|
||||
#define Py_TPFLAGS_ITEMS_AT_END (1UL << 23)
|
||||
|
||||
/* These flags are used to determine if a type is a subclass. */
|
||||
#define Py_TPFLAGS_LONG_SUBCLASS (1UL << 24)
|
||||
#define Py_TPFLAGS_LIST_SUBCLASS (1UL << 25)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue