Merged
Conversation
Source commit: python/typeshed@c38fc45
This is allegedly causing large performance problems, see 13821 typeshed/8231 had zero hits on mypy_primer, so it's not the worst thing to undo. Patching this in typeshed also feels weird, since there's a more general soundness issue. If a typevar has a bound or constraint, we might not want to solve it to a Literal. If we can confirm the performance regression or fix the unsoundness within mypy, I might pursue upstreaming this in typeshed. (Reminder: add this to the sync_typeshed script once merged)
Since the plugin provides superior type checking: python#13987 (comment) A manual cherry-pick of e437cdf.
Contributor
|
Diff from mypy_primer, showing the effect of this PR on open source code: koda-validate (https://github.com/keithasaurus/koda-validate)
+ koda_validate/namedtuple.py:207: error: No overload variant of "NamedTuple" matches argument type "dict[Any, Any]" [call-overload]
+ koda_validate/namedtuple.py:207: note: Possible overload variants:
+ koda_validate/namedtuple.py:207: note: def __init__(self, str, Iterable[tuple[str, Any]], /) -> _NTT
+ koda_validate/namedtuple.py:207: note: def __init__(self, str, None = ..., /, **kwargs: Any) -> _NTT
+ koda_validate/namedtuple.py:258: error: No overload variant of "NamedTuple" matches argument type "dict[Any, Any]" [call-overload]
+ koda_validate/namedtuple.py:258: note: Possible overload variants:
+ koda_validate/namedtuple.py:258: note: def __init__(self, str, Iterable[tuple[str, Any]], /) -> _NTT
+ koda_validate/namedtuple.py:258: note: def __init__(self, str, None = ..., /, **kwargs: Any) -> _NTT
anyio (https://github.com/agronholm/anyio)
+ src/anyio/_core/_fileio.py:382: error: Unused "type: ignore" comment [unused-ignore]
pydantic (https://github.com/samuelcolvin/pydantic)
+ pydantic/v1/validators.py:614: error: No overload variant of "NamedTuple" matches argument type "dict[str, Any]" [call-overload]
+ pydantic/v1/validators.py:614: note: Possible overload variants:
+ pydantic/v1/validators.py:614: note: def __init__(self, str, Iterable[tuple[str, Any]], /) -> NamedTupleT
+ pydantic/v1/validators.py:614: note: def __init__(self, str, None = ..., /, **kwargs: Any) -> NamedTupleT
ibis (https://github.com/ibis-project/ibis)
+ ibis/common/egraph.py:111: error: Argument 1 of "__eq__" is incompatible with supertype "Mapping"; supertype defines the argument type as "object" [override]
streamlit (https://github.com/streamlit/streamlit)
- lib/tests/streamlit/connections/base_connection_test.py: note: In member "test_secrets_property_no_matching_section" of class "ExperimentalBaseConnectionDefaultMethodTests":
- lib/tests/streamlit/connections/base_connection_test.py:58:16: error: Non-overlapping equality check (left operand type: "AttrDict", right operand type: "Dict[<nothing>, <nothing>]") [comparison-overlap]
- lib/tests/streamlit/connections/base_connection_test.py: note: In member "test_secrets_property_no_secrets" of class "ExperimentalBaseConnectionDefaultMethodTests":
- lib/tests/streamlit/connections/base_connection_test.py:62:16: error: Non-overlapping equality check (left operand type: "AttrDict", right operand type: "Dict[<nothing>, <nothing>]") [comparison-overlap]
materialize (https://github.com/MaterializeInc/materialize)
+ misc/python/materialize/mzcompose/__init__.py:904: error: Signature of "parse_known_args" incompatible with supertype "ArgumentParser" [override]
+ misc/python/materialize/mzcompose/__init__.py:904: note: Superclass:
+ misc/python/materialize/mzcompose/__init__.py:904: note: @overload
+ misc/python/materialize/mzcompose/__init__.py:904: note: def parse_known_args(self, args: Optional[Sequence[str]] = ..., namespace: Optional[Namespace] = ...) -> tuple[Namespace, list[str]]
+ misc/python/materialize/mzcompose/__init__.py:904: note: @overload
+ misc/python/materialize/mzcompose/__init__.py:904: note: def [_N] parse_known_args(self, args: Optional[Sequence[str]], namespace: _N) -> tuple[_N, list[str]]
+ misc/python/materialize/mzcompose/__init__.py:904: note: @overload
+ misc/python/materialize/mzcompose/__init__.py:904: note: def [_N] parse_known_args(self, *, namespace: _N) -> tuple[_N, list[str]]
+ misc/python/materialize/mzcompose/__init__.py:904: note: Subclass:
+ misc/python/materialize/mzcompose/__init__.py:904: note: def parse_known_args(self, args: Optional[Sequence[str]] = ..., namespace: Optional[Namespace] = ...) -> tuple[Namespace, list[str]]
+ misc/python/materialize/cli/mzcompose.py:670: error: Signature of "parse_known_args" incompatible with supertype "ArgumentParser" [override]
+ misc/python/materialize/cli/mzcompose.py:670: note: Superclass:
+ misc/python/materialize/cli/mzcompose.py:670: note: @overload
+ misc/python/materialize/cli/mzcompose.py:670: note: def parse_known_args(self, args: Optional[Sequence[str]] = ..., namespace: Optional[Namespace] = ...) -> tuple[Namespace, list[str]]
+ misc/python/materialize/cli/mzcompose.py:670: note: @overload
+ misc/python/materialize/cli/mzcompose.py:670: note: def [_N] parse_known_args(self, args: Optional[Sequence[str]], namespace: _N) -> tuple[_N, list[str]]
+ misc/python/materialize/cli/mzcompose.py:670: note: @overload
+ misc/python/materialize/cli/mzcompose.py:670: note: def [_N] parse_known_args(self, *, namespace: _N) -> tuple[_N, list[str]]
+ misc/python/materialize/cli/mzcompose.py:670: note: Subclass:
+ misc/python/materialize/cli/mzcompose.py:670: note: def parse_known_args(self, args: Optional[Sequence[str]] = ..., namespace: Optional[Namespace] = ...) -> tuple[Namespace, list[str]]
+ misc/python/materialize/cli/mzcompose.py:681: error: Signature of "parse_known_args" incompatible with supertype "ArgumentParser" [override]
+ misc/python/materialize/cli/mzcompose.py:681: note: Superclass:
+ misc/python/materialize/cli/mzcompose.py:681: note: @overload
+ misc/python/materialize/cli/mzcompose.py:681: note: def parse_known_args(self, args: Optional[Sequence[str]] = ..., namespace: Optional[Namespace] = ...) -> tuple[Namespace, list[str]]
+ misc/python/materialize/cli/mzcompose.py:681: note: @overload
+ misc/python/materialize/cli/mzcompose.py:681: note: def [_N] parse_known_args(self, args: Optional[Sequence[str]], namespace: _N) -> tuple[_N, list[str]]
+ misc/python/materialize/cli/mzcompose.py:681: note: @overload
+ misc/python/materialize/cli/mzcompose.py:681: note: def [_N] parse_known_args(self, *, namespace: _N) -> tuple[_N, list[str]]
+ misc/python/materialize/cli/mzcompose.py:681: note: Subclass:
+ misc/python/materialize/cli/mzcompose.py:681: note: def parse_known_args(self, args: Optional[Sequence[str]] = ..., namespace: Optional[Namespace] = ...) -> tuple[Namespace, list[str]]
|
Member
Author
I don't know why the PEP-561 test is failing -- looks like it's also failing on |
Member
Maybe setuptools or tox or something made a release that broke it? Opened #15446 to track. |
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.
Source commit: python/typeshed@c38fc45
Changes in
builtinsandfunctoolscaused the automated PR failed last night due to merge conflicts in the cherry-picks: https://github.com/python/mypy/actions/runs/5273276786