summaryrefslogtreecommitdiffstats
path: root/Objects/genericaliasobject.c
diff options
context:
space:
mode:
authorOleg Iarygin <oleg@arhadthedev.net>2022-04-18 03:39:32 (GMT)
committerGitHub <noreply@github.com>2022-04-18 03:39:32 (GMT)
commita573cb2fec664c645ab744658d7e941d72e1a398 (patch)
treea44303e326da2ea7406397c6640cf0d51ab3eb43 /Objects/genericaliasobject.c
parent328dbc051f84bd5fdf61101bb4fa61d85f8b7feb (diff)
downloadcpython-a573cb2fec664c645ab744658d7e941d72e1a398.zip
cpython-a573cb2fec664c645ab744658d7e941d72e1a398.tar.gz
cpython-a573cb2fec664c645ab744658d7e941d72e1a398.tar.bz2
gh-91118: Fix docstrings that do not honor --without-doc-strings (#31769)
Co-authored-by: Éric <merwok@netwok.org> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Diffstat (limited to 'Objects/genericaliasobject.c')
-rw-r--r--Objects/genericaliasobject.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/Objects/genericaliasobject.c b/Objects/genericaliasobject.c
index 3f03630..dc585de 100644
--- a/Objects/genericaliasobject.c
+++ b/Objects/genericaliasobject.c
@@ -341,6 +341,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)
{
@@ -703,14 +708,11 @@ ga_iter(PyObject *self) {
// 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,