https://github.com/python/cpython/commit/b6d32363305e8e22eedcbdf8e6af2c96bfe15cdc
commit: b6d32363305e8e22eedcbdf8e6af2c96bfe15cdc
branch: 3.14
author: Miss Islington (bot) <[email protected]>
committer: serhiy-storchaka <[email protected]>
date: 2026-06-11T17:21:12Z
summary:

[3.14] gh-150285: Fix too long docstrings in GenericAlias and __class_getitem__ 
(GH-151354) (GH-151368)

(cherry picked from commit 65047f2e2fb80e4ad36df56a343d75963a20c110)

Co-authored-by: Serhiy Storchaka <[email protected]>

files:
M Objects/genericaliasobject.c
M Objects/tupleobject.c
M Objects/typevarobject.c

diff --git a/Objects/genericaliasobject.c b/Objects/genericaliasobject.c
index 6e4dc7d6d48969..e6ee0b74e38f83 100644
--- a/Objects/genericaliasobject.c
+++ b/Objects/genericaliasobject.c
@@ -569,7 +569,8 @@ PyDoc_STRVAR(genericalias__doc__,
 "--\n\n"
 "Represent a PEP 585 generic type\n"
 "\n"
-"E.g. for t = list[int], t.__origin__ is list and t.__args__ is (int,).");
+"For example, for t = list[int], t.__origin__ is list and t.__args__\n"
+"is (int,).");
 
 static PyObject *
 ga_getitem(PyObject *self, PyObject *item)
diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c
index a0ec8321f61358..0f7a37faa91a57 100644
--- a/Objects/tupleobject.c
+++ b/Objects/tupleobject.c
@@ -878,8 +878,10 @@ tuple___getnewargs___impl(PyTupleObject *self)
 
 PyDoc_STRVAR(tuple_class_getitem_doc,
 "Tuples are generic over the types of their contents.\n\n\
-For example, use ``tuple[int, str]`` for a pair whose first element is an int 
and second element is a string.\n\n\
-Tuples also support the form ``tuple[T, ...]`` to indicate an arbitrary length 
tuple of elements of type T.");
+For example, use ``tuple[int, str]`` for a pair whose first element\n\
+is an int and second element is a string.\n\n\
+Tuples also support the form ``tuple[T, ...]`` to indicate\n\
+an arbitrary length tuple of elements of type T.");
 
 static PyMethodDef tuple_methods[] = {
     TUPLE___GETNEWARGS___METHODDEF
diff --git a/Objects/typevarobject.c b/Objects/typevarobject.c
index a52a4cb7d5b4d6..80d3fd488afae2 100644
--- a/Objects/typevarobject.c
+++ b/Objects/typevarobject.c
@@ -2218,8 +2218,9 @@ PyDoc_STRVAR(generic_class_getitem_doc,
 "Parameterizes a generic class.\n\
 \n\
 At least, parameterizing a generic class is the *main* thing this\n\
-method does. For example, for some generic class `Foo`, this is called\n\
-when we do `Foo[int]` - there, with `cls=Foo` and `params=int`.\n\
+method does.  For example, for some generic class `Foo`, this is\n\
+called when we do `Foo[int]` - there, with `cls=Foo` and\n\
+`params=int`.\n\
 \n\
 However, note that this method is also called when defining generic\n\
 classes in the first place with `class Foo[T]: ...`.\n\

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to