try fix more generic way for set and dict #3265 - #4877
Open
asukaminato0721 wants to merge 1 commit into
Open
asukaminato0721 wants to merge 1 commit into
asukaminato0721 wants to merge 1 commit into
Conversation
Contributor
|
This pull request has been imported. If you are a Meta employee, you can view this in D119446581. (Because this pull request was imported automatically, there will not be any future comments.) |
This comment has been minimized.
This comment has been minimized.
asukaminato0721
force-pushed
the
3265
branch
from
September 16, 2026 09:05
43200dc to
48d2a64
Compare
This comment has been minimized.
This comment has been minimized.
asukaminato0721
force-pushed
the
3265
branch
from
September 17, 2026 21:01
48d2a64 to
1d6ea0d
Compare
|
Diff from mypy_primer, showing the effect of this PR on open source code: ============================================================
SUMMARY
============================================================
Total: +8 new errors, -13 fixed errors
By preset: +4/-4 (default), +5/-13 (strict)
Projects with changes (5):
cki-lib: +1 -1
rotki: +0 -7
zope.interface: +3 -4
core: +2 -1
sphinx: +2 -0
============================================================
FULL DIFF DETAILS
------------------------------------------------------------
cki-lib (https://gitlab.com/cki-project/cki-lib)
- ERROR cki_lib/metrics/server.py:23:12-24: Returned type `Iterator[Any] | Iterator[Unknown]` is not assignable to declared return type `None` [bad-return]
+ ERROR cki_lib/metrics/server.py:23:12-24: Returned type `Iterator[Unknown]` is not assignable to declared return type `None` [bad-return]
rotki (https://github.com/rotki/rotki)
- ERROR rotkehlchen/tests/exchanges/test_coinbaseprime.py:341:27-29: Cannot infer type of empty container; it will be treated as containing `Any` [implicit-any-empty-container]
- ERROR rotkehlchen/tests/exchanges/test_coinbaseprime.py:345:36-38: Cannot infer type of empty container; it will be treated as containing `Any` [implicit-any-empty-container]
- ERROR rotkehlchen/tests/exchanges/test_coinbaseprime.py:364:27-29: Cannot infer type of empty container; it will be treated as containing `Any` [implicit-any-empty-container]
- ERROR rotkehlchen/tests/exchanges/test_coinbaseprime.py:368:36-38: Cannot infer type of empty container; it will be treated as containing `Any` [implicit-any-empty-container]
- ERROR rotkehlchen/tests/exchanges/test_coinbaseprime.py:387:27-29: Cannot infer type of empty container; it will be treated as containing `Any` [implicit-any-empty-container]
- ERROR rotkehlchen/tests/exchanges/test_coinbaseprime.py:391:36-38: Cannot infer type of empty container; it will be treated as containing `Any` [implicit-any-empty-container]
- ERROR rotkehlchen/tests/exchanges/test_coinbaseprime.py:414:36-38: Cannot infer type of empty container; it will be treated as containing `Any` [implicit-any-empty-container]
zope.interface (https://github.com/zopefoundation/zope.interface)
- ERROR src/zope/interface/common/tests/test_collections.py:118:19-21: Cannot infer type of empty container; it will be treated as containing `Any` [implicit-any-empty-container]
+ ERROR src/zope/interface/common/tests/test_collections.py:122:23-25: Cannot infer type of empty container; it will be treated as containing `Any` [implicit-any-empty-container]
- ERROR src/zope/interface/common/tests/test_collections.py:118:46-48: Cannot infer type of empty container; it will be treated as containing `Any` [implicit-any-empty-container]
- ERROR src/zope/interface/common/tests/test_collections.py:135:22-38: Cannot set item in `dict[type[IItemsView] | type[IKeysView] | type[IValuesView] | type[MappingProxyType] | type[UserString] | type[memoryview] | type[range] | str | type[Generator[int] | Iterator[LiteralString] | Iterator[int] | Iterator[tuple[Unknown, Unknown]] | Iterator[Any] | Iterator[Unknown]], (() -> Generator[int]) | (() -> Iterator[LiteralString]) | (() -> Iterator[int]) | (() -> Iterator[tuple[Unknown, Unknown]]) | (() -> Iterator[Any]) | (() -> Iterator[Unknown]) | (() -> MappingProxyType[Unknown, Unknown]) | (() -> UserString) | (() -> memoryview) | (() -> range) | (() -> dict_items[Unknown, Unknown]) | (() -> dict_keys[Unknown, Unknown]) | (() -> dict_values[Unknown, Unknown]) | type[SkipTest]]` [unsupported-operation]
+ ERROR src/zope/interface/common/tests/test_collections.py:135:22-38: Cannot set item in `dict[type[IItemsView] | type[IKeysView] | type[IValuesView] | type[MappingProxyType] | type[UserString] | type[memoryview] | type[range] | str | type[Generator[int] | Iterator[LiteralString] | Iterator[int] | Iterator[tuple[Any, Any]] | Iterator[Any] | Iterator[Unknown]], (() -> Generator[int]) | (() -> Iterator[LiteralString]) | (() -> Iterator[int]) | (() -> Iterator[tuple[Any, Any]]) | (() -> Iterator[Any]) | (() -> Iterator[Unknown]) | (() -> MappingProxyType[Unknown, Unknown]) | (() -> UserString) | (() -> memoryview) | (() -> range) | (() -> dict_items[Unknown, Unknown]) | (() -> dict_keys[Unknown, Unknown]) | (() -> dict_values[Unknown, Unknown]) | type[SkipTest]]` [unsupported-operation]
- ERROR src/zope/interface/common/tests/test_collections.py:135:42-70: Cannot set item in `dict[type[IItemsView] | type[IKeysView] | type[IValuesView] | type[MappingProxyType] | type[UserString] | type[memoryview] | type[range] | str | type[Generator[int] | Iterator[LiteralString] | Iterator[int] | Iterator[tuple[Unknown, Unknown]] | Iterator[Any] | Iterator[Unknown]], (() -> Generator[int]) | (() -> Iterator[LiteralString]) | (() -> Iterator[int]) | (() -> Iterator[tuple[Unknown, Unknown]]) | (() -> Iterator[Any]) | (() -> Iterator[Unknown]) | (() -> MappingProxyType[Unknown, Unknown]) | (() -> UserString) | (() -> memoryview) | (() -> range) | (() -> dict_items[Unknown, Unknown]) | (() -> dict_keys[Unknown, Unknown]) | (() -> dict_values[Unknown, Unknown]) | type[SkipTest]]` [unsupported-operation]
+ ERROR src/zope/interface/common/tests/test_collections.py:135:42-70: Cannot set item in `dict[type[IItemsView] | type[IKeysView] | type[IValuesView] | type[MappingProxyType] | type[UserString] | type[memoryview] | type[range] | str | type[Generator[int] | Iterator[LiteralString] | Iterator[int] | Iterator[tuple[Any, Any]] | Iterator[Any] | Iterator[Unknown]], (() -> Generator[int]) | (() -> Iterator[LiteralString]) | (() -> Iterator[int]) | (() -> Iterator[tuple[Any, Any]]) | (() -> Iterator[Any]) | (() -> Iterator[Unknown]) | (() -> MappingProxyType[Unknown, Unknown]) | (() -> UserString) | (() -> memoryview) | (() -> range) | (() -> dict_items[Unknown, Unknown]) | (() -> dict_keys[Unknown, Unknown]) | (() -> dict_values[Unknown, Unknown]) | type[SkipTest]]` [unsupported-operation]
core (https://github.com/home-assistant/core)
- ERROR homeassistant/components/min_max/sensor.py:259:57-261:14: `Event[dict[str, Any]]` is not assignable to `Event[EventStateChangedData]` [bad-assignment]
+ ERROR homeassistant/components/min_max/sensor.py:259:57-261:14: `Event[dict[str, State | str | None]]` is not assignable to `Event[EventStateChangedData]` [bad-assignment]
+ ERROR homeassistant/components/pilight/__init__.py:131:37-46: The type of this argument is unknown [unknown-argument-type]
sphinx (https://github.com/sphinx-doc/sphinx)
+ ERROR sphinx/ext/autodoc/_legacy_class_based/_documenters.py:2078:17-68: The type of this argument is unknown [unknown-argument-type]
+ ERROR sphinx/ext/autodoc/_legacy_class_based/_documenters.py:2730:21-72: The type of this argument is unknown [unknown-argument-type] |
This branch has not been deployed
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 #3265
Moved the fix into the shared solver.
Any in a generic bound no longer becomes a contextual hint that erases inferred element types.
Test Plan
add test