diff options
author | kj <28750310+Fidget-Spinner@users.noreply.github.com> | 2020-10-31 20:25:44 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-31 20:25:44 (GMT) |
commit | 3bf0d02f2817c48b6ee61a95b52a6d76ad543be9 (patch) | |
tree | 6d75c747a06870ba59514e42473443ab8cc89158 /Doc/library | |
parent | 02cdfc93f82fecdb7eae97a868d4ee222b9875d9 (diff) | |
download | cpython-3bf0d02f2817c48b6ee61a95b52a6d76ad543be9.zip cpython-3bf0d02f2817c48b6ee61a95b52a6d76ad543be9.tar.gz cpython-3bf0d02f2817c48b6ee61a95b52a6d76ad543be9.tar.bz2 |
bpo-42198: New section in stdtypes for type annotation types (GH-23063)
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/stdtypes.rst | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 8a9cadd..84d5a3a 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -4764,10 +4764,20 @@ Compared to the overhead of setting up the runtime context, the overhead of a single class dictionary lookup is negligible. +Type Annotation Types --- :ref:`Generic Alias <types-genericalias>`, :ref:`Union <types-union>` +=============================================================================================== + +.. index:: + single: annotation; type annotation; type hint + +The core built-in types for :term:`type annotations <annotation>` are +:ref:`Generic Alias <types-genericalias>` and :ref:`Union <types-union>`. + + .. _types-genericalias: Generic Alias Type -================== +------------------ .. index:: object: GenericAlias @@ -4870,7 +4880,7 @@ in the ``GenericAlias`` object's :attr:`__args__ <genericalias.__args__>`. :: Standard Generic Collections ----------------------------- +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ These standard library collections support parameterized generics. @@ -4915,7 +4925,7 @@ These standard library collections support parameterized generics. Special Attributes of Generic Alias ------------------------------------ +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ All parameterized generics implement special read-only attributes. @@ -4961,7 +4971,7 @@ All parameterized generics implement special read-only attributes. .. _types-union: Union Type -========== +---------- .. index:: object: Union |