Skip to content

Commit 98d1d2d

Browse files
vstinnerseehwan80
authored andcommitted
pythongh-111178: Fix type of PyCMethod's "nargs" argument (pythonGH-131135)
Replace "size_t nargs" with "Py_ssize_t nargs" in PyCMethod.
1 parent 2b9e987 commit 98d1d2d

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Include/methodobject.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ typedef PyObject *(*PyCFunctionFastWithKeywords) (PyObject *,
2424
PyObject *const *, Py_ssize_t,
2525
PyObject *);
2626
typedef PyObject *(*PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *,
27-
size_t, PyObject *);
27+
Py_ssize_t, PyObject *);
2828

2929
// For backwards compatibility. `METH_FASTCALL` was added to the stable API in
3030
// 3.10 alongside `_PyCFunctionFastWithKeywords` and `_PyCFunctionFast`.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix :c:type:`PyCMethod` API: replace ``size_t nargs`` with ``Py_ssize_t nargs``
2+
in :c:type:`PyCMethod`. Patch by Victor Stinner.

0 commit comments

Comments
 (0)