From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Fri, 25 May 2018 04:51:14 +0000 (-0700) Subject: Document typing.NoReturn (GH-7107) X-Git-Tag: v3.7.0b5~44 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=82d727fce68577d9f44f9ecfaf20bd4581a66404;p=python Document typing.NoReturn (GH-7107) (cherry picked from commit 6e413f4327a68c4c7d62e0b6d0f9144be11dd6cd) Co-authored-by: Ivan Levkivskyi --- 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.