Skip to content

Commit e9b08d3

Browse files
authored
Use new PyCFunctionFastWithKeywords and PyCFunctionFast in Python 3.13a4 (GH-6003)
Python 3.13a4 adds a public PyCFunctionFastWithKeywords and PyCFunctionFast types and removes the private _PyCFunctionFastWithKeywords and _PyCFunctionFast types: * python/cpython@9e3729b * python/cpython#114627 * capi-workgroup/decisions#11
1 parent a8b26e9 commit e9b08d3

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

Cython/Utility/CythonFunction.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,7 @@ static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func,
10191019
return NULL;
10201020
}
10211021

1022-
return ((_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames);
1022+
return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames);
10231023
}
10241024

10251025
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)

Cython/Utility/ModuleSetupCode.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -907,8 +907,13 @@ class __Pyx_FakeReference {
907907
typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
908908
Py_ssize_t nargs, PyObject *kwnames);
909909
#else
910-
#define __Pyx_PyCFunctionFast _PyCFunctionFast
911-
#define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
910+
#if PY_VERSION_HEX >= 0x030d00A4
911+
# define __Pyx_PyCFunctionFast PyCFunctionFast
912+
# define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords
913+
#else
914+
# define __Pyx_PyCFunctionFast _PyCFunctionFast
915+
# define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
916+
#endif
912917
#endif
913918

914919
#if CYTHON_METH_FASTCALL

0 commit comments

Comments
 (0)