From 6d3024fb19d1ea6cca4d1dcf0d8613846a860652 Mon Sep 17 00:00:00 2001 From: Michael Lee Date: Thu, 20 Jul 2017 21:24:34 -0700 Subject: [PATCH] Add NoReturn type to typing stubs (#1496) --- stdlib/2/typing.pyi | 5 +++++ stdlib/3/typing.pyi | 5 +++++ 2 files changed, 10 insertions(+) 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: