-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Don't erase type object args in diagnostics #18352
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
Conversation
This comment has been minimized.
This comment has been minimized.
Diff from mypy_primer, showing the effect of this PR on open source code: Tanjun (https://github.com/FasterSpeeding/Tanjun)
- tanjun/clients.py:2428: error: Argument 1 to "get_type_dependency" of "Client" has incompatible type "type[SingleStoreCache[Any]]"; expected "type[SingleStoreCache[Application]] | type[None]" [arg-type]
+ tanjun/clients.py:2428: error: Argument 1 to "get_type_dependency" of "Client" has incompatible type "type[SingleStoreCache[AuthorizationApplication]]"; expected "type[SingleStoreCache[Application]] | type[None]" [arg-type]
operator (https://github.com/canonical/operator)
- ops/charm.py:1756: error: Incompatible types in assignment (expression has type "object", variable has type "type[list[Any]]") [assignment]
+ ops/charm.py:1756: error: Incompatible types in assignment (expression has type "object", variable has type "type[list[str]]") [assignment]
steam.py (https://github.com/Gobot1234/steam.py)
- steam/client.py:1276: error: Invalid self argument "type[TradeOffer[Any, Any, Any]]" to attribute function "_from_history" with type "Callable[[type[TradeOffer[MovedItem[UserT], MovedItem[ClientUser], UserT]], ConnectionState, TradeOfferHistoryTrade, Sequence[Description]], TradeOffer[MovedItem[UserT], MovedItem[ClientUser], UserT]]" [misc]
+ steam/client.py:1276: error: Invalid self argument "type[TradeOffer[ReceivingAssetT, SendingAssetT, UserT]]" to attribute function "_from_history" with type "Callable[[type[TradeOffer[MovedItem[UserT], MovedItem[ClientUser], UserT]], ConnectionState, TradeOfferHistoryTrade, Sequence[Description]], TradeOffer[MovedItem[UserT], MovedItem[ClientUser], UserT]]" [misc]
ibis (https://github.com/ibis-project/ibis)
- ibis/expr/operations/__init__.py:8: error: Incompatible import of "Literal" (imported name has type "<typing special form>", local name has type "type[Literal[Any]]") [assignment]
+ ibis/expr/operations/__init__.py:8: error: Incompatible import of "Literal" (imported name has type "<typing special form>", local name has type "type[Literal[T]]") [assignment]
- ibis/expr/operations/__init__.py:13: error: Incompatible import of "Literal" (imported name has type "<typing special form>", local name has type "type[Literal[Any]]") [assignment]
+ ibis/expr/operations/__init__.py:13: error: Incompatible import of "Literal" (imported name has type "<typing special form>", local name has type "type[Literal[T]]") [assignment]
- ibis/expr/operations/__init__.py:14: error: Incompatible import of "Literal" (imported name has type "<typing special form>", local name has type "type[Literal[Any]]") [assignment]
+ ibis/expr/operations/__init__.py:14: error: Incompatible import of "Literal" (imported name has type "<typing special form>", local name has type "type[Literal[T]]") [assignment]
- ibis/expr/operations/__init__.py:20: error: Incompatible import of "Literal" (imported name has type "<typing special form>", local name has type "type[Literal[Any]]") [assignment]
+ ibis/expr/operations/__init__.py:20: error: Incompatible import of "Literal" (imported name has type "<typing special form>", local name has type "type[Literal[T]]") [assignment]
- ibis/expr/types/relations.py:4401: error: Argument 1 to "map" has incompatible type "type[tuple[Any, ...]]"; expected "Callable[[list[str]], str]" [arg-type]
+ ibis/expr/types/relations.py:4401: error: Argument 1 to "map" has incompatible type "type[tuple[_T_co, ...]]"; expected "Callable[[list[str]], str]" [arg-type]
werkzeug (https://github.com/pallets/werkzeug)
- tests/test_wrappers.py:1057: error: Incompatible types in assignment (expression has type "type[tuple[Any, ...]]", variable has type "type[list[Any]]") [assignment]
+ tests/test_wrappers.py:1057: error: Incompatible types in assignment (expression has type "type[tuple[_T_co, ...]]", variable has type "type[list[Any]]") [assignment]
- tests/test_wrappers.py:1059: error: Non-overlapping identity check (left operand type: "type[list[str]]", right operand type: "type[tuple[Any, ...]]") [comparison-overlap]
+ tests/test_wrappers.py:1059: error: Non-overlapping identity check (left operand type: "type[list[str]]", right operand type: "type[tuple[_T_co, ...]]") [comparison-overlap]
- tests/test_local.py:231: error: Non-overlapping identity check (left operand type: "type[list[Any]]", right operand type: "type[LocalProxy[Any]]") [comparison-overlap]
+ tests/test_local.py:231: error: Non-overlapping identity check (left operand type: "type[list[Any]]", right operand type: "type[LocalProxy[T]]") [comparison-overlap]
|
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.
Looks fine, I wonder why we were using erase_type()
in the first place.
Dates to #3374 (comment) |
Fixes #16875