projects
/
python
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
17d8830
)
Document typing.NoReturn (GH-7107)
author
Ivan Levkivskyi
<levkivskyi@gmail.com>
Fri, 25 May 2018 04:33:55 +0000
(21:33 -0700)
committer
GitHub
<noreply@github.com>
Fri, 25 May 2018 04:33:55 +0000
(21:33 -0700)
Doc/library/typing.rst
patch
|
blob
|
history
diff --git
a/Doc/library/typing.rst
b/Doc/library/typing.rst
index be6636eea08fbb8f13176eb3999920b6549d44d7..91d10e324cae296762427bb154b8dcee76d255f4 100644
(file)
--- 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.