[3.10] gh-91118: Fix docstrings that do not honor --without-doc-strings (GH-31769) (#91662)

Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
(cherry picked from commit a573cb2fec)

Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
This commit is contained in:
Oleg Iarygin 2022-04-19 23:01:09 +03:00 committed by GitHub
parent a885f10325
commit e7e8a9fa4f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 81 additions and 65 deletions

View file

@ -349,6 +349,11 @@ _Py_subs_parameters(PyObject *self, PyObject *args, PyObject *parameters, PyObje
return newargs;
}
PyDoc_STRVAR(genericalias__doc__,
"Represent a PEP 585 generic type\n"
"\n"
"E.g. for t = list[int], t.__origin__ is list and t.__args__ is (int,).");
static PyObject *
ga_getitem(PyObject *self, PyObject *item)
{
@ -628,14 +633,11 @@ static PyNumberMethods ga_as_number = {
// TODO:
// - argument clinic?
// - __doc__?
// - cache?
PyTypeObject Py_GenericAliasType = {
PyVarObject_HEAD_INIT(&PyType_Type, 0)
.tp_name = "types.GenericAlias",
.tp_doc = "Represent a PEP 585 generic type\n"
"\n"
"E.g. for t = list[int], t.__origin__ is list and t.__args__ is (int,).",
.tp_doc = genericalias__doc__,
.tp_basicsize = sizeof(gaobject),
.tp_dealloc = ga_dealloc,
.tp_repr = ga_repr,