False positive: Type
objects (including type[cls]
) are incompatible with Hashable
#17730
Labels
bug
mypy got something wrong
Bug Report
In python, classes themselves, like
int
, are hashable.A variable annotated with just
type
is correctly recognized as an instance ofcollections.abc.Hashable
; however, a variable annotated withtype[int]
,Type
, orType[int]
is wrongly considered incompatible withHashable
.To Reproduce
Expected Behavior
No error, and consistent among
x
,y
, andz
.Actual Behavior
Both
y
andz
give an error, but notx
.Note:
type
andType
are considered different: the problem lies withType
.Your Environment
The text was updated successfully, but these errors were encountered: