Skip to content

Commit 0b9c4c6

Browse files
authored
bpo-42171: Add PEP573-related items to the limited API (GH-23009)
1 parent 9303b9e commit 0b9c4c6

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

Doc/c-api/structures.rst

+4-2
Original file line numberDiff line numberDiff line change
@@ -263,10 +263,12 @@ There are these calling conventions:
263263
of :c:type:`PyObject*` values indicating the arguments and the third
264264
parameter is the number of arguments (the length of the array).
265265
266-
This is not part of the :ref:`limited API <stable>`.
267-
268266
.. versionadded:: 3.7
269267
268+
.. versionchanged:: 3.10
269+
270+
``METH_FASTCALL`` is now part of the stable ABI.
271+
270272
271273
.. data:: METH_FASTCALL | METH_KEYWORDS
272274

Include/methodobject.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ PyAPI_FUNC(PyObject *) PyCMethod_New(PyMethodDef *, PyObject *,
7373

7474
#define METH_COEXIST 0x0040
7575

76-
#ifndef Py_LIMITED_API
76+
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03100000
7777
#define METH_FASTCALL 0x0080
7878
#endif
7979

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
The :c:data:`METH_FASTCALL` calling convention is added to the limited API.
2+
The functions :c:func:`PyModule_AddType`, :c:func:`PyType_FromModuleAndSpec`,
3+
:c:func:`PyType_GetModule` and :c:func:`PyType_GetModuleState` are added to
4+
the limited API on Windows.

PC/python3dll.c

+4
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,7 @@ EXPORT_FUNC(PyModule_AddFunctions)
344344
EXPORT_FUNC(PyModule_AddIntConstant)
345345
EXPORT_FUNC(PyModule_AddObject)
346346
EXPORT_FUNC(PyModule_AddStringConstant)
347+
EXPORT_FUNC(PyModule_AddType)
347348
EXPORT_FUNC(PyModule_Create2)
348349
EXPORT_FUNC(PyModule_ExecDef)
349350
EXPORT_FUNC(PyModule_FromDefAndSpec2)
@@ -547,9 +548,12 @@ EXPORT_FUNC(PyTuple_Size)
547548
EXPORT_FUNC(PyType_ClearCache)
548549
EXPORT_FUNC(PyType_FromSpec)
549550
EXPORT_FUNC(PyType_FromSpecWithBases)
551+
EXPORT_FUNC(PyType_FromModuleAndSpec)
550552
EXPORT_FUNC(PyType_GenericAlloc)
551553
EXPORT_FUNC(PyType_GenericNew)
552554
EXPORT_FUNC(PyType_GetFlags)
555+
EXPORT_FUNC(PyType_GetModule)
556+
EXPORT_FUNC(PyType_GetModuleState)
553557
EXPORT_FUNC(PyType_GetSlot)
554558
EXPORT_FUNC(PyType_IsSubtype)
555559
EXPORT_FUNC(PyType_Modified)

0 commit comments

Comments
 (0)