summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2018-05-24 21:51:14 -0700
committerGitHub <noreply@github.com>2018-05-24 21:51:14 -0700
commit82d727fce68577d9f44f9ecfaf20bd4581a66404 (patch)
tree22a760a74c419219fab6cfb031727e260d3fb250
parent5734f41a9b46b4fd65b6ba90240b108f8a0b7c57 (diff)
downloadcpython-git-82d727fce68577d9f44f9ecfaf20bd4581a66404.tar.gz
Document typing.NoReturn (GH-7107)
(cherry picked from commit 6e413f4327a68c4c7d62e0b6d0f9144be11dd6cd) Co-authored-by: Ivan Levkivskyi <levkivskyi@gmail.com>
-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 be6636eea0..91d10e324c 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.