From fe7cd0c52974b6791517b68436e33175cf05ee7e Mon Sep 17 00:00:00 2001 From: hauntsaninja <> Date: Wed, 15 Dec 2021 18:01:33 -0800 Subject: [PATCH 1/2] mypy_extensions: fix NoReturn, remove inaccurate comment --- stubs/mypy-extensions/mypy_extensions.pyi | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/stubs/mypy-extensions/mypy_extensions.pyi b/stubs/mypy-extensions/mypy_extensions.pyi index fc6de37d07d1..0d8cc011e4ae 100644 --- a/stubs/mypy-extensions/mypy_extensions.pyi +++ b/stubs/mypy-extensions/mypy_extensions.pyi @@ -34,9 +34,8 @@ def VarArg(type: _T = ...) -> _T: ... def KwArg(type: _T = ...) -> _T: ... # 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] # Deprecated: Use typing.NoReturn instead. +# Deprecated: Use typing.NoReturn instead. +class NoReturn: ... # This is intended as a class decorator, but mypy rejects abstract classes # when a Type[_T] is expected, so we can't give it the type we want From 74ed3faf7be99cebfe177d87d1f210902e97df51 Mon Sep 17 00:00:00 2001 From: hauntsaninja <> Date: Wed, 15 Dec 2021 18:08:15 -0800 Subject: [PATCH 2/2] import --- stubs/mypy-extensions/mypy_extensions.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stubs/mypy-extensions/mypy_extensions.pyi b/stubs/mypy-extensions/mypy_extensions.pyi index 0d8cc011e4ae..dd182c485177 100644 --- a/stubs/mypy-extensions/mypy_extensions.pyi +++ b/stubs/mypy-extensions/mypy_extensions.pyi @@ -1,6 +1,6 @@ import abc import sys -from typing import Any, Callable, Generic, ItemsView, KeysView, Mapping, Type, TypeVar, Union, ValuesView +from typing import Any, Callable, Generic, ItemsView, KeysView, Mapping, Type, TypeVar, ValuesView _T = TypeVar("_T") _U = TypeVar("_U")