gh-96364: Fix text signatures of __getitem__ for list and dict (GH-96365)

This commit is contained in:
Nikita Sobolev 2022-09-09 11:37:02 +03:00 committed by GitHub
parent 569ca27293
commit 30cc1901ef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 2 deletions

View file

@ -3591,7 +3591,8 @@ dict_ior(PyObject *self, PyObject *other)
return self;
}
PyDoc_STRVAR(getitem__doc__, "x.__getitem__(y) <==> x[y]");
PyDoc_STRVAR(getitem__doc__,
"__getitem__($self, key, /)\n--\n\nReturn self[key].");
PyDoc_STRVAR(sizeof__doc__,
"D.__sizeof__() -> size of D in memory, in bytes");

View file

@ -2824,7 +2824,8 @@ static PyObject *list_iter(PyObject *seq);
static PyObject *list_subscript(PyListObject*, PyObject*);
static PyMethodDef list_methods[] = {
{"__getitem__", (PyCFunction)list_subscript, METH_O|METH_COEXIST, "x.__getitem__(y) <==> x[y]"},
{"__getitem__", (PyCFunction)list_subscript, METH_O|METH_COEXIST,
PyDoc_STR("__getitem__($self, index, /)\n--\n\nReturn self[index].")},
LIST___REVERSED___METHODDEF
LIST___SIZEOF___METHODDEF
LIST_CLEAR_METHODDEF