https://github.com/python/cpython/commit/bbe5baad6c84615aa9a4473b1391137c1db3403b commit: bbe5baad6c84615aa9a4473b1391137c1db3403b branch: main author: Victor Stinner <vstin...@python.org> committer: vstinner <vstin...@python.org> date: 2025-03-19T13:46:17Z summary:
gh-111178: Fix function signatures for test_types (#131455) files: M Objects/namespaceobject.c M Objects/odictobject.c M Python/Python-tokenize.c diff --git a/Objects/namespaceobject.c b/Objects/namespaceobject.c index a9de9fe13f9ce1..caebe6bf543567 100644 --- a/Objects/namespaceobject.c +++ b/Objects/namespaceobject.c @@ -204,8 +204,9 @@ namespace_richcompare(PyObject *self, PyObject *other, int op) PyDoc_STRVAR(namespace_reduce__doc__, "Return state information for pickling"); static PyObject * -namespace_reduce(_PyNamespaceObject *ns, PyObject *Py_UNUSED(ignored)) +namespace_reduce(PyObject *op, PyObject *Py_UNUSED(ignored)) { + _PyNamespaceObject *ns = (_PyNamespaceObject*)op; PyObject *result, *args = PyTuple_New(0); if (!args) @@ -245,7 +246,7 @@ namespace_replace(PyObject *self, PyObject *args, PyObject *kwargs) static PyMethodDef namespace_methods[] = { - {"__reduce__", (PyCFunction)namespace_reduce, METH_NOARGS, + {"__reduce__", namespace_reduce, METH_NOARGS, namespace_reduce__doc__}, {"__replace__", _PyCFunction_CAST(namespace_replace), METH_VARARGS|METH_KEYWORDS, PyDoc_STR("__replace__($self, /, **changes)\n--\n\n" diff --git a/Objects/odictobject.c b/Objects/odictobject.c index 28ff40b4900fb3..c1126220006839 100644 --- a/Objects/odictobject.c +++ b/Objects/odictobject.c @@ -1883,8 +1883,9 @@ odictiter_new(PyODictObject *od, int kind) /* keys() */ static PyObject * -odictkeys_iter(_PyDictViewObject *dv) +odictkeys_iter(PyObject *op) { + _PyDictViewObject *dv = (_PyDictViewObject*)op; if (dv->dv_dict == NULL) { Py_RETURN_NONE; } @@ -1934,7 +1935,7 @@ PyTypeObject PyODictKeys_Type = { 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ - (getiterfunc)odictkeys_iter, /* tp_iter */ + odictkeys_iter, /* tp_iter */ 0, /* tp_iternext */ odictkeys_methods, /* tp_methods */ 0, /* tp_members */ @@ -1951,8 +1952,9 @@ odictkeys_new(PyObject *od, PyObject *Py_UNUSED(ignored)) /* items() */ static PyObject * -odictitems_iter(_PyDictViewObject *dv) +odictitems_iter(PyObject *op) { + _PyDictViewObject *dv = (_PyDictViewObject*)op; if (dv->dv_dict == NULL) { Py_RETURN_NONE; } @@ -2002,7 +2004,7 @@ PyTypeObject PyODictItems_Type = { 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ - (getiterfunc)odictitems_iter, /* tp_iter */ + odictitems_iter, /* tp_iter */ 0, /* tp_iternext */ odictitems_methods, /* tp_methods */ 0, /* tp_members */ diff --git a/Python/Python-tokenize.c b/Python/Python-tokenize.c index 50ce83d18f6e73..152d61c686722e 100644 --- a/Python/Python-tokenize.c +++ b/Python/Python-tokenize.c @@ -239,8 +239,9 @@ _get_col_offsets(tokenizeriterobject *it, struct token token, const char *line_s } static PyObject * -tokenizeriter_next(tokenizeriterobject *it) +tokenizeriter_next(PyObject *op) { + tokenizeriterobject *it = (tokenizeriterobject*)op; PyObject* result = NULL; Py_BEGIN_CRITICAL_SECTION(it); @@ -348,8 +349,9 @@ tokenizeriter_next(tokenizeriterobject *it) } static void -tokenizeriter_dealloc(tokenizeriterobject *it) +tokenizeriter_dealloc(PyObject *op) { + tokenizeriterobject *it = (tokenizeriterobject*)op; PyTypeObject *tp = Py_TYPE(it); Py_XDECREF(it->last_line); _PyTokenizer_Free(it->tok); _______________________________________________ Python-checkins mailing list -- python-checkins@python.org To unsubscribe send an email to python-checkins-le...@python.org https://mail.python.org/mailman3/lists/python-checkins.python.org/ Member address: arch...@mail-archive.com