You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mypy does not match dict[int, int] with Mapping[Hashable, Any] when it is in Union[Mapping[Hashable, Any], Hashable] but it matches when Mapping[Hashable, Any] is by itself.
error: Argument 1 to "myfun2" has incompatible type "Dict[int, int]"; expected "Union[Mapping[Hashable, Any], Hashable]"
note: Following member(s) of "Dict[int, int]" have conflicts:
note: __hash__: expected "Callable[[], int]", got "None"
No error with pyright.
Your Environment
Mypy version used: 0.942
The text was updated successfully, but these errors were encountered:
Bug Report
Mypy does not match
dict[int, int]
withMapping[Hashable, Any]
when it is inUnion[Mapping[Hashable, Any], Hashable]
but it matches whenMapping[Hashable, Any]
is by itself.To Reproduce
Example from @Dr-Irv:
Expected Behavior
No error.
Actual Behavior
No error with pyright.
Your Environment
The text was updated successfully, but these errors were encountered: