Skip to content

Commit

Permalink
Use new PyCFunctionFastWithKeywords and PyCFunctionFast in Python 3.1…
Browse files Browse the repository at this point in the history
…3a4 (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
  • Loading branch information
vstinner authored and scoder committed Feb 18, 2024
1 parent b44db63 commit e8d42b1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cython/Utility/CythonFunction.c
Expand Up @@ -1058,7 +1058,7 @@ static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func,
return NULL;
}

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

static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
Expand Down
9 changes: 7 additions & 2 deletions Cython/Utility/ModuleSetupCode.c
Expand Up @@ -873,8 +873,13 @@ class __Pyx_FakeReference {
typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
Py_ssize_t nargs, PyObject *kwnames);
#else
#define __Pyx_PyCFunctionFast _PyCFunctionFast
#define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
#if PY_VERSION_HEX >= 0x030d00A4
# define __Pyx_PyCFunctionFast PyCFunctionFast
# define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords
#else
# define __Pyx_PyCFunctionFast _PyCFunctionFast
# define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
#endif
#endif

#if CYTHON_METH_FASTCALL
Expand Down

0 comments on commit e8d42b1

Please sign in to comment.