Skip to content

Commit 6e413f4

Browse files
authored
Document typing.NoReturn (GH-7107)
1 parent 17d8830 commit 6e413f4

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Doc/library/typing.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -937,6 +937,18 @@ The module defines the following classes, functions and decorators:
937937
* Every type is compatible with :data:`Any`.
938938
* :data:`Any` is compatible with every type.
939939

940+
.. data:: NoReturn
941+
942+
Special type indicating that a function never returns.
943+
For example::
944+
945+
from typing import NoReturn
946+
947+
def stop() -> NoReturn:
948+
raise RuntimeError('no way')
949+
950+
.. versionadded:: 3.6.5
951+
940952
.. data:: Union
941953

942954
Union type; ``Union[X, Y]`` means either X or Y.

0 commit comments

Comments
 (0)