Closed
Description
$ cat tmp/typesort.py
from typing import Type
from functools import lru_cache
class A:
pass
@lru_cache()
def f(x: Type[A]) -> None:
pass
x: Type[A]
f(x)
$ mypy tmp/typesort.py
tmp/typesort.py:15: error: Argument 1 to "__call__" of "_lru_cache_wrapper" has incompatible type "Type[A]"; expected "Hashable"
Found 1 error in 1 file (checked 1 source file)
This is a regression in mypy 0.790, but I haven't figured out whether it's due to changes in typeshed or mypy. I'm hoping it's fixable in typeshed. Interestingly mypy allows {x}
(a set with x
in it).
Metadata
Metadata
Assignees
Labels
No labels