From 0a622249f7f6632488972f374a4f28066313d09c Mon Sep 17 00:00:00 2001 From: Naomi Seyfer Date: Sat, 24 Dec 2016 21:01:10 -0800 Subject: [PATCH 1/7] Argument constructors for experimental flexible callable feature This is the typeshed for the constructors for the Arg types that we'll now be able to pass to Callable. They really just return their type arguments. --- third_party/2and3/mypy_extensions.pyi | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/third_party/2and3/mypy_extensions.pyi b/third_party/2and3/mypy_extensions.pyi index 6c57954d8a81..f34fedc1c141 100644 --- a/third_party/2and3/mypy_extensions.pyi +++ b/third_party/2and3/mypy_extensions.pyi @@ -1,6 +1,18 @@ -from typing import Dict, Type, TypeVar +from typing import Any, Dict, Type, TypeVar T = TypeVar('T') def TypedDict(typename: str, fields: Dict[str, Type[T]]) -> Type[dict]: ... + +def Arg(name: Optional[str] = ..., typ: T = ...) -> T: ... + +def DefaultArg(name: Optional[str] = ..., typ: T = ...) -> T: ... + +def NamedArg(name: Optional[str] = ..., typ: T = ...) -> T: ... + +def DefaultNamedArg(name: Optional[str] = ..., typ: T = ...) -> T: ... + +def StarArg(typ: T = ...) -> T: ... + +def KwArg(typ: T = ...) -> T: ... \ No newline at end of file From 6b7df4ad4fa0828059c1da0ed4af94cc33f31da6 Mon Sep 17 00:00:00 2001 From: Naomi Seyfer Date: Sat, 24 Dec 2016 22:28:19 -0800 Subject: [PATCH 2/7] lint --- 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 f34fedc1c141..cc7ac8b701c7 100644 --- a/third_party/2and3/mypy_extensions.pyi +++ b/third_party/2and3/mypy_extensions.pyi @@ -1,4 +1,4 @@ -from typing import Any, Dict, Type, TypeVar +from typing import Any, Dict, Type, TypeVar, Optional T = TypeVar('T') From fadd7d8847412ac1f9d3439e8aa14f944daf9db5 Mon Sep 17 00:00:00 2001 From: Naomi Seyfer Date: Sat, 24 Dec 2016 22:30:41 -0800 Subject: [PATCH 3/7] extraneous import --- 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 cc7ac8b701c7..3c5fca911ddb 100644 --- a/third_party/2and3/mypy_extensions.pyi +++ b/third_party/2and3/mypy_extensions.pyi @@ -1,4 +1,4 @@ -from typing import Any, Dict, Type, TypeVar, Optional +from typing import Dict, Type, TypeVar, Optional T = TypeVar('T') From a25752bc7406c6a42acd3c9e99235d41efcf193a Mon Sep 17 00:00:00 2001 From: Naomi Seyfer Date: Sat, 24 Dec 2016 22:41:40 -0800 Subject: [PATCH 4/7] newline --- 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 3c5fca911ddb..7e5ed7736ef3 100644 --- a/third_party/2and3/mypy_extensions.pyi +++ b/third_party/2and3/mypy_extensions.pyi @@ -15,4 +15,4 @@ def DefaultNamedArg(name: Optional[str] = ..., typ: T = ...) -> T: ... def StarArg(typ: T = ...) -> T: ... -def KwArg(typ: T = ...) -> T: ... \ No newline at end of file +def KwArg(typ: T = ...) -> T: ... From bcaea7c34fbccf537e4259ccde5edc6a24b35c42 Mon Sep 17 00:00:00 2001 From: Naomi Seyfer Date: Wed, 19 Apr 2017 23:17:17 -0700 Subject: [PATCH 5/7] Switch the order, fix things up with mergeout --- third_party/2and3/mypy_extensions.pyi | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/third_party/2and3/mypy_extensions.pyi b/third_party/2and3/mypy_extensions.pyi index c8c21c8efc7f..8e0c34fc49e0 100644 --- a/third_party/2and3/mypy_extensions.pyi +++ b/third_party/2and3/mypy_extensions.pyi @@ -3,19 +3,17 @@ from typing import Dict, Type, TypeVar, Optional, Union _T = TypeVar('_T') -def TypedDict(typename: str, fields: Dict[str, Type[T]]) -> Type[dict]: ... +def Arg(typ: _T = ..., name: Optional[str] = ...) -> _T: ... -def Arg(name: Optional[str] = ..., typ: T = ...) -> T: ... +def DefaultArg(typ: _T = ..., name: Optional[str] = ...) -> _T: ... -def DefaultArg(name: Optional[str] = ..., typ: T = ...) -> T: ... +def NamedArg(typ: _T = ..., name: Optional[str] = ...) -> _T: ... -def NamedArg(name: Optional[str] = ..., typ: T = ...) -> T: ... +def DefaultNamedArg(typ: _T = ..., name: Optional[str] = ...) -> _T: ... -def DefaultNamedArg(name: Optional[str] = ..., typ: T = ...) -> T: ... +def VarArg(typ: _T = ...) -> _T: ... -def StarArg(typ: T = ...) -> T: ... - -def KwArg(typ: T = ...) -> T: ... +def KwArg(typ: _T = ...) -> _T: ... def TypedDict(typename: str, fields: Dict[str, Type[_T]]) -> Type[dict]: ... From 5b0302e3740832a47415fbe9c6202174bff3441e Mon Sep 17 00:00:00 2001 From: Naomi Seyfer Date: Fri, 21 Apr 2017 10:08:29 -0700 Subject: [PATCH 6/7] "type" instead of "typ" --- third_party/2and3/mypy_extensions.pyi | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/third_party/2and3/mypy_extensions.pyi b/third_party/2and3/mypy_extensions.pyi index 8e0c34fc49e0..ae9aa8984116 100644 --- a/third_party/2and3/mypy_extensions.pyi +++ b/third_party/2and3/mypy_extensions.pyi @@ -3,20 +3,21 @@ from typing import Dict, Type, TypeVar, Optional, Union _T = TypeVar('_T') -def Arg(typ: _T = ..., name: Optional[str] = ...) -> _T: ... +def TypedDict(typename: str, fields: Dict[str, Type[_T]]) -> Type[dict]: ... -def DefaultArg(typ: _T = ..., name: Optional[str] = ...) -> _T: ... -def NamedArg(typ: _T = ..., name: Optional[str] = ...) -> _T: ... +def Arg(type: _T = ..., name: Optional[str] = ...) -> _T: ... -def DefaultNamedArg(typ: _T = ..., name: Optional[str] = ...) -> _T: ... +def DefaultArg(type: _T = ..., name: Optional[str] = ...) -> _T: ... -def VarArg(typ: _T = ...) -> _T: ... +def NamedArg(type: _T = ..., name: Optional[str] = ...) -> _T: ... -def KwArg(typ: _T = ...) -> _T: ... +def DefaultNamedArg(type: _T = ..., name: Optional[str] = ...) -> _T: ... +def VarArg(type: _T = ...) -> _T: ... + +def KwArg(type: _T = ...) -> _T: ... -def TypedDict(typename: str, fields: Dict[str, Type[_T]]) -> Type[dict]: ... # 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 From a47f7e3d1de7812f2a6851a80cb320835db3bb40 Mon Sep 17 00:00:00 2001 From: Naomi Seyfer Date: Tue, 2 May 2017 13:22:50 -0700 Subject: [PATCH 7/7] Remove lots of whitespace --- third_party/2and3/mypy_extensions.pyi | 7 ------- 1 file changed, 7 deletions(-) diff --git a/third_party/2and3/mypy_extensions.pyi b/third_party/2and3/mypy_extensions.pyi index ae9aa8984116..80b0d780b569 100644 --- a/third_party/2and3/mypy_extensions.pyi +++ b/third_party/2and3/mypy_extensions.pyi @@ -5,20 +5,13 @@ _T = TypeVar('_T') def TypedDict(typename: str, fields: Dict[str, Type[_T]]) -> Type[dict]: ... - def Arg(type: _T = ..., name: Optional[str] = ...) -> _T: ... - def DefaultArg(type: _T = ..., name: Optional[str] = ...) -> _T: ... - def NamedArg(type: _T = ..., name: Optional[str] = ...) -> _T: ... - def DefaultNamedArg(type: _T = ..., name: Optional[str] = ...) -> _T: ... - 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.