Unverified Kaydet (Commit) 36f066a9 authored tarafından Miss Islington (bot)'s avatar Miss Islington (bot) Kaydeden (comit) GitHub

Document typing.NoReturn (GH-7107)

(cherry picked from commit 6e413f43)
Co-authored-by: 's avatarIvan Levkivskyi <levkivskyi@gmail.com>
üst fc0356d2
...@@ -938,6 +938,18 @@ The module defines the following classes, functions and decorators: ...@@ -938,6 +938,18 @@ The module defines the following classes, functions and decorators:
* Every type is compatible with :data:`Any`. * Every type is compatible with :data:`Any`.
* :data:`Any` is compatible with every type. * :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 .. data:: Union
Union type; ``Union[X, Y]`` means either X or Y. Union type; ``Union[X, Y]`` means either X or Y.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment