Closed
Description
Mypy complains about this code, even though it looks fine to me:
from typing import Sequence, TypeVar
_T = TypeVar('_T')
def bisect_left(a: Sequence[_T], x: _T) -> int: ...
bisect_left([1, 2, 3], 5.391) # Cannot infer type argument 1 of "bisect_left"
This doesn't seem to be related to promotions, as it also happens with user-defined types:
class A: pass
class B(A): pass
bisect_left([B()], A()) # same error