mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
Document typing.NoReturn (GH-7107)
This commit is contained in:
parent
17d8830312
commit
6e413f4327
1 changed files with 12 additions and 0 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue