summaryrefslogtreecommitdiffstats
path: root/Lib/typing.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2020-05-10 12:14:27 (GMT)
committerGitHub <noreply@github.com>2020-05-10 12:14:27 (GMT)
commit2fbc57af851814df567fb51054cb6f6a399f814a (patch)
tree001e00f93b25c31f19a8e158213917d9643ea73d /Lib/typing.py
parent0122d48681b1df27015cf396559fb283ba364d6d (diff)
downloadcpython-2fbc57af851814df567fb51054cb6f6a399f814a.zip
cpython-2fbc57af851814df567fb51054cb6f6a399f814a.tar.gz
cpython-2fbc57af851814df567fb51054cb6f6a399f814a.tar.bz2
bpo-40257: Tweak docstrings for special generic aliases. (GH-20022)
* Add the terminating period. * Omit module name for builtin types.
Diffstat (limited to 'Lib/typing.py')
-rw-r--r--Lib/typing.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/typing.py b/Lib/typing.py
index b5ba38e..f94996d 100644
--- a/Lib/typing.py
+++ b/Lib/typing.py
@@ -753,7 +753,10 @@ class _SpecialGenericAlias(_BaseGenericAlias, _root=True):
name = origin.__name__
super().__init__(origin, inst=inst, name=name)
self._nparams = nparams
- self.__doc__ = f'A generic version of {origin.__module__}.{origin.__qualname__}'
+ if origin.__module__ == 'builtins':
+ self.__doc__ = f'A generic version of {origin.__qualname__}.'
+ else:
+ self.__doc__ = f'A generic version of {origin.__module__}.{origin.__qualname__}.'
@_tp_cache
def __getitem__(self, params):