Skip to content

Commit 6a9d74d

Browse files
sixoletJukkaL
authored andcommitted
Args for "flexible callable" experimental mypy feature. (#793)
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.
1 parent b6a9a05 commit 6a9d74d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

third_party/2and3/mypy_extensions.pyi

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1-
from typing import Dict, Type, TypeVar, Union
1+
from typing import Dict, Type, TypeVar, Optional, Union
22

33
_T = TypeVar('_T')
44

55

66
def TypedDict(typename: str, fields: Dict[str, Type[_T]]) -> Type[dict]: ...
77

8+
def Arg(type: _T = ..., name: Optional[str] = ...) -> _T: ...
9+
def DefaultArg(type: _T = ..., name: Optional[str] = ...) -> _T: ...
10+
def NamedArg(type: _T = ..., name: Optional[str] = ...) -> _T: ...
11+
def DefaultNamedArg(type: _T = ..., name: Optional[str] = ...) -> _T: ...
12+
def VarArg(type: _T = ...) -> _T: ...
13+
def KwArg(type: _T = ...) -> _T: ...
14+
815
# Return type that indicates a function does not return.
916
# This type is equivalent to the None type, but the no-op Union is necessary to
1017
# distinguish the None type from the None value.

0 commit comments

Comments
 (0)