-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
bugmypy got something wrongmypy got something wrong
Description
The following code:
from typing import Sequence
class A:
pass
d: Sequence[A] = ()
s = sorted(d)
print("OK")produces the following output:
$ python3 Test.py
OK
$ mypy Test.py
Test.py:8:5: error: Value of type variable "_LT" of "sorted" cannot be "A" [type-var]
s = sorted(d)
$ python3 --version
Python 3.8.5
$ mypy --version
mypy 0.790The code seems perfectly valid, so mypy reaction looks a false positive.
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrong