From 1f6922d3aa8f0dc6b79c3052873b2ab02058b1fe Mon Sep 17 00:00:00 2001 From: Naomi Seyfer Date: Sun, 30 Apr 2017 21:49:50 -0700 Subject: [PATCH 1/4] Typeshed support for mypy_extensions.decorated_type --- third_party/2and3/mypy_extensions.pyi | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/third_party/2and3/mypy_extensions.pyi b/third_party/2and3/mypy_extensions.pyi index 48bdac21fedd..b982562edaeb 100644 --- a/third_party/2and3/mypy_extensions.pyi +++ b/third_party/2and3/mypy_extensions.pyi @@ -1,4 +1,4 @@ -from typing import Dict, Type, TypeVar, Union +from typing import Dict, Type, TypeVar, Union, Callable _T = TypeVar('_T') @@ -9,3 +9,5 @@ def TypedDict(typename: str, fields: Dict[str, Type[_T]]) -> Type[dict]: ... # 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] + +def decorated_type(t: Type) -> Callable[[_T], _T]: pass \ No newline at end of file From fb52ecec68345b24cf298d4437f101c12ee73049 Mon Sep 17 00:00:00 2001 From: Naomi Seyfer Date: Sun, 30 Apr 2017 22:07:58 -0700 Subject: [PATCH 2/4] nits --- third_party/2and3/mypy_extensions.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/third_party/2and3/mypy_extensions.pyi b/third_party/2and3/mypy_extensions.pyi index b982562edaeb..679750b65a03 100644 --- a/third_party/2and3/mypy_extensions.pyi +++ b/third_party/2and3/mypy_extensions.pyi @@ -1,4 +1,4 @@ -from typing import Dict, Type, TypeVar, Union, Callable +from typing import Dict, Type, TypeVar, Union, Callable, Any _T = TypeVar('_T') @@ -10,4 +10,4 @@ def TypedDict(typename: str, fields: Dict[str, Type[_T]]) -> Type[dict]: ... # distinguish the None type from the None value. NoReturn = Union[None] -def decorated_type(t: Type) -> Callable[[_T], _T]: pass \ No newline at end of file +def decorated_type(t: Type[Any]) -> Callable[[_T], _T]: ... From d08d318f7672213d0b76a085c157f724d676e1df Mon Sep 17 00:00:00 2001 From: Naomi Seyfer Date: Tue, 2 May 2017 13:29:18 -0700 Subject: [PATCH 3/4] Any type can be a type --- third_party/2and3/mypy_extensions.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/2and3/mypy_extensions.pyi b/third_party/2and3/mypy_extensions.pyi index 679750b65a03..890e0b8e315d 100644 --- a/third_party/2and3/mypy_extensions.pyi +++ b/third_party/2and3/mypy_extensions.pyi @@ -10,4 +10,4 @@ def TypedDict(typename: str, fields: Dict[str, Type[_T]]) -> Type[dict]: ... # distinguish the None type from the None value. NoReturn = Union[None] -def decorated_type(t: Type[Any]) -> Callable[[_T], _T]: ... +def decorated_type(t: Any) -> Callable[[_T], _T]: ... From 9e5cd3c4b7a9a54bdeabaa9e9c6f09d1fa999ff6 Mon Sep 17 00:00:00 2001 From: Naomi Seyfer Date: Wed, 14 Jun 2017 21:44:11 -0700 Subject: [PATCH 4/4] decorated_type -> declared_type --- third_party/2and3/mypy_extensions.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/2and3/mypy_extensions.pyi b/third_party/2and3/mypy_extensions.pyi index 7501fbe63869..c46b470d6a85 100644 --- a/third_party/2and3/mypy_extensions.pyi +++ b/third_party/2and3/mypy_extensions.pyi @@ -16,4 +16,4 @@ def KwArg(type: _T = ...) -> _T: ... # distinguish the None type from the None value. NoReturn = Union[None] -def decorated_type(t: Any) -> Callable[[_T], _T]: ... +def declared_type(t: Any) -> Callable[[_T], _T]: ...