PyDocs

Nav

Development Tools

NoReturn

typing

data
Special type indicating functions that never return.

Example::

    from typing import NoReturn

    def stop() -> NoReturn:
        raise Exception('no way')

NoReturn can also be used as a bottom type, a type that
has no values. Starting in Python 3.11, the Never type should
be used for this concept instead. Type checkers should treat the two
equivalently.
Changed in 3.6.2, 3.11
  • 3.6.2: Added NoReturn.
  • 3.11: Added Never.
0 Examples
No examples for typing/NoReturn.
See Also
No see-alsos for typing/NoReturn
0 Notes
No notes for NoReturn