-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Basic support for ParamSpec type checking #11594
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
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
2007165
[WIP] Include param_spec in callable types and support reveal_Type
JukkaL da6d041
[WIP] Simple type inference involving ParamSpec
JukkaL 2506647
[WIP] Work towards using ParamSpec in classes
JukkaL 56971f0
[WIP] Support defining decorators
JukkaL 774a558
Various fixes
JukkaL cc8fc46
Fixes to mypy daemon (not tested yet)
JukkaL 5b8a1c6
Various updates/fixes to ParamSpecType
JukkaL bb928ce
Fix to type semantic analysis
JukkaL f3a2596
Add missing get_proper_type call
JukkaL ef52db7
Fixes to self check
JukkaL c76ce08
Fix type check of mypy.constraints
JukkaL 8a69923
Add missing get_proper_type() calls
JukkaL 76ffb14
Move some param spec logic to CallableType
JukkaL be6f8e8
Fix applying types with ParamSpec
JukkaL c1686b0
Switch to simpler ParamSpec implementation + cleanup
JukkaL a3cb0ad
Fix inference against Any
JukkaL fd124c5
Update test cases
JukkaL 22afc1d
Don't wrap ParamSpec *args and **kwargs types in tuple[...] or dict[...]
JukkaL 044ddfd
Implement basic type checking for ParamSpec types
JukkaL 6d25da4
Use Callable[P, T] in error messages
JukkaL 1047f85
Support subtype checks
JukkaL a9b410e
Implement ParamSpec join
JukkaL f621fb7
Fix type erasure
JukkaL 080049e
Add test case
JukkaL 504267c
Disallow ParamSpec type in bad location
JukkaL 2d02b62
Fix type check and lint
JukkaL dd28b93
Minor tweaks
JukkaL 01ae7d5
Fix TODO in string conversion
JukkaL b6b09f1
Update docstrings
JukkaL 1af097f
Respond to feedback
JukkaL File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 think you should update the proper_plugin to not require this.
ParamSpecType
can never by a target of a type alias. (NoteTypeVarType
is already excluded).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.
A good idea! Done. Also removed various now-redundant
get_proper_type
calls.