mirror of
https://github.com/python/cpython.git
synced 2025-07-07 11:25:30 +00:00
gh-111178: Fix function signatures for test_types (#131455)
This commit is contained in:
parent
f5e4c2955b
commit
bbe5baad6c
3 changed files with 13 additions and 8 deletions
|
@ -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"
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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 @@ exit:
|
|||
}
|
||||
|
||||
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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue