summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Levkivskyi <levkivskyi@gmail.com>2018-05-25 04:33:55 (GMT)
committerGitHub <noreply@github.com>2018-05-25 04:33:55 (GMT)
commit6e413f4327a68c4c7d62e0b6d0f9144be11dd6cd (patch)
tree18c06f0b6cec4d75adb2e04b3e62a21b055912da
parent17d8830312d82e7de42ab89739b0771f712645ff (diff)
downloadcpython-6e413f4327a68c4c7d62e0b6d0f9144be11dd6cd.zip
cpython-6e413f4327a68c4c7d62e0b6d0f9144be11dd6cd.tar.gz
cpython-6e413f4327a68c4c7d62e0b6d0f9144be11dd6cd.tar.bz2
Document typing.NoReturn (GH-7107)
-rw-r--r--Doc/library/typing.rst12
1 files changed, 12 insertions, 0 deletions
diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst
index be6636e..91d10e3 100644
--- a/Doc/library/typing.rst
+++ b/Doc/library/typing.rst
@@ -937,6 +937,18 @@ The module defines the following classes, functions and decorators:
* Every type is compatible with :data:`Any`.
* :data:`Any` is compatible with every type.
+.. data:: NoReturn
+
+ Special type indicating that a function never returns.
+ For example::
+
+ from typing import NoReturn
+
+ def stop() -> NoReturn:
+ raise RuntimeError('no way')
+
+ .. versionadded:: 3.6.5
+
.. data:: Union
Union type; ``Union[X, Y]`` means either X or Y.