]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-42198: New section in stdtypes for type annotation types (GH-23063)
authorkj <28750310+Fidget-Spinner@users.noreply.github.com>
Sat, 31 Oct 2020 20:25:44 +0000 (04:25 +0800)
committerGitHub <noreply@github.com>
Sat, 31 Oct 2020 20:25:44 +0000 (13:25 -0700)
Doc/library/stdtypes.rst

index 8a9cadde7d5dc4cb7e3d0ed97ac99f9e878786eb..84d5a3a59f0b40237eaa36535d454ebb1ed86a37 100644 (file)
@@ -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