Correctly handle variadic instances with empty arguments#16238
Merged
ilevkivskyi merged 4 commits intopython:masterfrom Oct 16, 2023
Merged
Correctly handle variadic instances with empty arguments#16238ilevkivskyi merged 4 commits intopython:masterfrom
ilevkivskyi merged 4 commits intopython:masterfrom
Conversation
This comment has been minimized.
This comment has been minimized.
Member
Author
|
Oh wow, it looks like all the errors in the primer are real. Previously we didn't report an error for missing type argument for a generic class if it appeared inside a union in a target of a type alias. I added a regression test. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Contributor
|
Diff from mypy_primer, showing the effect of this PR on open source code: schema_salad (https://github.com/common-workflow-language/schema_salad)
+ mypy-stubs/mistune/block_parser.pyi:19: note: In module imported here,
+ mypy-stubs/mistune/markdown.pyi:4: note: ... from here,
+ schema_salad/makedoc.py:36: note: ... from here:
+ mypy-stubs/mistune/scanner.pyi:19:52: error: Missing type parameters for generic type "Match" [type-arg]
cwltool (https://github.com/common-workflow-language/cwltool)
+ cwltool/job.py:115:65: error: Missing type parameters for generic type "partial" [type-arg]
websockets (https://github.com/aaugustin/websockets)
+ src/websockets/typing.py:29: error: Missing type parameters for generic type "LoggerAdapter" [type-arg]
python-chess (https://github.com/niklasf/python-chess)
+ chess/polyglot.py:14: error: Missing type parameters for generic type "PathLike" [type-arg]
koda-validate (https://github.com/keithasaurus/koda-validate)
+ koda_validate/errors.py:164: error: Missing type parameters for generic type "PredicateErrs" [type-arg]
streamlit (https://github.com/streamlit/streamlit)
+ lib/streamlit/type_util.py:237:41: error: Implicit generic "Any". Use "typing.Dict" and specify generic parameters [type-arg]
+ lib/streamlit/type_util.py:237:47: error: Implicit generic "Any". Use "typing.List" and specify generic parameters [type-arg]
+ lib/streamlit/type_util.py:237:53: error: Implicit generic "Any". Use "typing.Set" and specify generic parameters [type-arg]
+ lib/streamlit/elements/arrow.py:49:5: error: Missing type parameters for generic type "Iterable" [type-arg]
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #16199
It was surprisingly hard to fix, because all possible fixes strongly interfered with the code that makes "no-args" aliases possible:
So after all I re-organized (and actually simplified) that old code.