fix Preserve class-scoped type parameters when converting __new__ to a callable #4267#4271
Open
asukaminato0721 wants to merge 1 commit into
Open
fix Preserve class-scoped type parameters when converting __new__ to a callable #4267#4271asukaminato0721 wants to merge 1 commit into
asukaminato0721 wants to merge 1 commit into
Conversation
|
Diff from mypy_primer, showing the effect of this PR on open source code: rotki (https://github.com/rotki/rotki)
+ ERROR rotkehlchen/db/settings.py:286:60-92: `frozenset[_T_co]` is not assignable to `frozenset[ExchangeLocationID]` [bad-assignment]
scikit-build-core (https://github.com/scikit-build/scikit-build-core)
+ ERROR src/scikit_build_core/build/_wheelfile.py:74:30-74: `frozenset[_T_co]` is not assignable to `AbstractSet[Tag]` [bad-assignment]
streamlit (https://github.com/streamlit/streamlit)
+ ERROR lib/streamlit/runtime/scriptrunner_utils/script_requests.py:61:45-77: `frozenset[_T_co]` is not assignable to `frozenset[str]` [bad-assignment]
+ ERROR lib/streamlit/runtime/scriptrunner_utils/script_run_context.py:209:45-77: `frozenset[_T_co]` is not assignable to `frozenset[str]` [bad-assignment]
ibis (https://github.com/ibis-project/ibis)
- ERROR ibis/expr/types/relations.py:4963:21-68: `list[tuple[Unknown, ...]]` is not assignable to variable `names` with type `Iterable[str] | None` [bad-assignment]
+ ERROR ibis/expr/types/relations.py:4963:21-68: `list[tuple[str, ...]]` is not assignable to variable `names` with type `Iterable[str] | None` [bad-assignment]
|
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.
Summary
Fixes #4267
Bare generic classes now preserve class-scoped type parameters when converting
__new__to a callable.Class8 correctly infers
Class8[str]and rejects inconsistent constructor arguments.Test Plan
Added regression coverage and updated generated conformance results.