mirror of
https://github.com/python/cpython.git
synced 2025-07-23 11:15:24 +00:00
bpo-38787: C API for module state access from extension methods (PEP 573) (GH-19936)
Module C state is now accessible from C-defined heap type methods (PEP 573). Patch by Marcel Plch and Petr Viktorin. Co-authored-by: Marcel Plch <mplch@redhat.com> Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
parent
4638c64295
commit
e1becf46b4
19 changed files with 797 additions and 51 deletions
|
@ -213,6 +213,11 @@ PyAPI_FUNC(PyObject*) PyType_FromSpecWithBases(PyType_Spec*, PyObject*);
|
|||
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03040000
|
||||
PyAPI_FUNC(void*) PyType_GetSlot(PyTypeObject*, int);
|
||||
#endif
|
||||
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03090000
|
||||
PyAPI_FUNC(PyObject*) PyType_FromModuleAndSpec(PyObject *, PyType_Spec *, PyObject *);
|
||||
PyAPI_FUNC(PyObject *) PyType_GetModule(struct _typeobject *);
|
||||
PyAPI_FUNC(void *) PyType_GetModuleState(struct _typeobject *);
|
||||
#endif
|
||||
|
||||
/* Generic type check */
|
||||
PyAPI_FUNC(int) PyType_IsSubtype(PyTypeObject *, PyTypeObject *);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue