-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Args for "flexible callable" experimental mypy feature. #793
Changes from 6 commits
0a62224
6b7df4a
fadd7d8
a25752b
60c9439
bcaea7c
5b0302e
a47f7e3
9f1535d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,21 @@ | ||
from typing import Dict, Type, TypeVar, Union | ||
from typing import Dict, Type, TypeVar, Optional, Union | ||
|
||
_T = TypeVar('_T') | ||
|
||
|
||
def Arg(typ: _T = ..., name: Optional[str] = ...) -> _T: ... | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rename There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I might prefer |
||
|
||
def DefaultArg(typ: _T = ..., name: Optional[str] = ...) -> _T: ... | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Another style nit: remove empty lines between functions (this is a typeshed convention). |
||
def NamedArg(typ: _T = ..., name: Optional[str] = ...) -> _T: ... | ||
|
||
def DefaultNamedArg(typ: _T = ..., name: Optional[str] = ...) -> _T: ... | ||
|
||
def VarArg(typ: _T = ...) -> _T: ... | ||
|
||
def KwArg(typ: _T = ...) -> _T: ... | ||
|
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Like above -- remove second empty line. |
||
def TypedDict(typename: str, fields: Dict[str, Type[_T]]) -> Type[dict]: ... | ||
|
||
# Return type that indicates a function does not return. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove second empty line (in typeshed we tend to use a single empty line between different sorts of things).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am a smartass and put this as a separate diff because it is unrelated: #1237