diff options
author | Petr Viktorin <encukou@gmail.com> | 2020-11-10 14:47:31 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-10 05:47:31 -0800 |
commit | 0b9c4c6fcf2b0673fa45ddfa092934a9d5479b8c (patch) | |
tree | 73ffdc1affed0b0404a1d7310de2a7920d8f92f4 | |
parent | Fix typo in test_array.py (GH-23189) (diff) | |
download | cpython-0b9c4c6fcf2b0673fa45ddfa092934a9d5479b8c.tar.gz cpython-0b9c4c6fcf2b0673fa45ddfa092934a9d5479b8c.tar.bz2 cpython-0b9c4c6fcf2b0673fa45ddfa092934a9d5479b8c.zip |
bpo-42171: Add PEP573-related items to the limited API (GH-23009)
-rw-r--r-- | Doc/c-api/structures.rst | 6 | ||||
-rw-r--r-- | Include/methodobject.h | 2 | ||||
-rw-r--r-- | Misc/NEWS.d/next/C API/2020-10-27-21-10-14.bpo-42171.S3FWTP.rst | 4 | ||||
-rw-r--r-- | PC/python3dll.c | 4 |
4 files changed, 13 insertions, 3 deletions
diff --git a/Doc/c-api/structures.rst b/Doc/c-api/structures.rst index 03fe479165f..37602ed5b4d 100644 --- a/Doc/c-api/structures.rst +++ b/Doc/c-api/structures.rst @@ -263,10 +263,12 @@ There are these calling conventions: of :c:type:`PyObject*` values indicating the arguments and the third parameter is the number of arguments (the length of the array). - This is not part of the :ref:`limited API <stable>`. - .. versionadded:: 3.7 + .. versionchanged:: 3.10 + + ``METH_FASTCALL`` is now part of the stable ABI. + .. data:: METH_FASTCALL | METH_KEYWORDS diff --git a/Include/methodobject.h b/Include/methodobject.h index 12e049b4043..5d06d7691ba 100644 --- a/Include/methodobject.h +++ b/Include/methodobject.h @@ -73,7 +73,7 @@ PyAPI_FUNC(PyObject *) PyCMethod_New(PyMethodDef *, PyObject *, #define METH_COEXIST 0x0040 -#ifndef Py_LIMITED_API +#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03100000 #define METH_FASTCALL 0x0080 #endif diff --git a/Misc/NEWS.d/next/C API/2020-10-27-21-10-14.bpo-42171.S3FWTP.rst b/Misc/NEWS.d/next/C API/2020-10-27-21-10-14.bpo-42171.S3FWTP.rst new file mode 100644 index 00000000000..5dfbb23a6a3 --- /dev/null +++ b/Misc/NEWS.d/next/C API/2020-10-27-21-10-14.bpo-42171.S3FWTP.rst @@ -0,0 +1,4 @@ +The :c:data:`METH_FASTCALL` calling convention is added to the limited API. +The functions :c:func:`PyModule_AddType`, :c:func:`PyType_FromModuleAndSpec`, +:c:func:`PyType_GetModule` and :c:func:`PyType_GetModuleState` are added to +the limited API on Windows. diff --git a/PC/python3dll.c b/PC/python3dll.c index d1fdd0ac54c..27cc315de2d 100644 --- a/PC/python3dll.c +++ b/PC/python3dll.c @@ -344,6 +344,7 @@ EXPORT_FUNC(PyModule_AddFunctions) EXPORT_FUNC(PyModule_AddIntConstant) EXPORT_FUNC(PyModule_AddObject) EXPORT_FUNC(PyModule_AddStringConstant) +EXPORT_FUNC(PyModule_AddType) EXPORT_FUNC(PyModule_Create2) EXPORT_FUNC(PyModule_ExecDef) EXPORT_FUNC(PyModule_FromDefAndSpec2) @@ -547,9 +548,12 @@ EXPORT_FUNC(PyTuple_Size) EXPORT_FUNC(PyType_ClearCache) EXPORT_FUNC(PyType_FromSpec) EXPORT_FUNC(PyType_FromSpecWithBases) +EXPORT_FUNC(PyType_FromModuleAndSpec) EXPORT_FUNC(PyType_GenericAlloc) EXPORT_FUNC(PyType_GenericNew) EXPORT_FUNC(PyType_GetFlags) +EXPORT_FUNC(PyType_GetModule) +EXPORT_FUNC(PyType_GetModuleState) EXPORT_FUNC(PyType_GetSlot) EXPORT_FUNC(PyType_IsSubtype) EXPORT_FUNC(PyType_Modified) |