diff --git a/stdlib/2/typing.pyi b/stdlib/2/typing.pyi index 84cd0d455..d8c49a421 100644 --- a/stdlib/2/typing.pyi +++ b/stdlib/2/typing.pyi @@ -24,6 +24,11 @@ ClassVar: _SpecialForm = ... class GenericMeta(type): ... +# Return type that indicates a function does not return. +# This type is equivalent to the None type, but the no-op Union is necessary to +# distinguish the None type from the None value. +NoReturn = Union[None] + # Type aliases and type constructors class TypeAlias: diff --git a/stdlib/3/typing.pyi b/stdlib/3/typing.pyi index e8d5b5bb2..71f97ce4c 100644 --- a/stdlib/3/typing.pyi +++ b/stdlib/3/typing.pyi @@ -25,6 +25,11 @@ ClassVar: _SpecialForm = ... class GenericMeta(type): ... +# Return type that indicates a function does not return. +# This type is equivalent to the None type, but the no-op Union is necessary to +# distinguish the None type from the None value. +NoReturn = Union[None] + # Type aliases and type constructors class TypeAlias: