Closed
Description
I think this is a bug:
from typing import Hashable, List, overload
@overload
def f(x: Hashable) -> str: ...
@overload
def f(x: List) -> str: ...
def f(x):
return repr(x)
mypy (0.720) reports:
typing_test.py:7: error: Overloaded function signature 2 will never be matched: signature 1's parameter type(s) are the same or broader
I would expect this to work without complaints. Python lists are not hashable, unless you make some strange subclass.
Metadata
Metadata
Assignees
Labels
No labels