Document typing.NoReturn (GH-7107)
(cherry picked from commit 6e413f4327
)
Co-authored-by: Ivan Levkivskyi <levkivskyi@gmail.com>
This commit is contained in:
parent
fc0356d2a3
commit
36f066a974
|
@ -938,6 +938,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.
|
||||
|
|
Loading…
Reference in New Issue