Skip to content

Commit 2fbc57a

Browse files
bpo-40257: Tweak docstrings for special generic aliases. (GH-20022)
* Add the terminating period. * Omit module name for builtin types.
1 parent 0122d48 commit 2fbc57a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Lib/typing.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,10 @@ def __init__(self, origin, nparams, *, inst=True, name=None):
753753
name = origin.__name__
754754
super().__init__(origin, inst=inst, name=name)
755755
self._nparams = nparams
756-
self.__doc__ = f'A generic version of {origin.__module__}.{origin.__qualname__}'
756+
if origin.__module__ == 'builtins':
757+
self.__doc__ = f'A generic version of {origin.__qualname__}.'
758+
else:
759+
self.__doc__ = f'A generic version of {origin.__module__}.{origin.__qualname__}.'
757760

758761
@_tp_cache
759762
def __getitem__(self, params):

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy