]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-40257: Tweak docstrings for special generic aliases. (GH-20022)
authorSerhiy Storchaka <storchaka@gmail.com>
Sun, 10 May 2020 12:14:27 +0000 (15:14 +0300)
committerGitHub <noreply@github.com>
Sun, 10 May 2020 12:14:27 +0000 (15:14 +0300)
* Add the terminating period.
* Omit module name for builtin types.

Lib/typing.py

index b5ba38e07c835bc812dabb726b6ff92d38eb2620..f94996daebd6ed8ce05c7ba32bae1a24a93fab6d 100644 (file)
@@ -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):