-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
bugmypy got something wrongmypy got something wrongfalse-positivemypy gave an error on correct codemypy gave an error on correct codepriority-0-hightopic-literal-types
Description
https://mypy-play.net/?mypy=latest&python=3.8&flags=strict&gist=9b082c260ecb9586b358a06c8583edc2
class A:
y: bool
def update(self) -> None:
pass
a = A()
assert a.y is True
a.update()
assert a.y is False
gives
main.py:9: error: Non-overlapping identity check (left operand type: "Literal[True]", right operand type: "Literal[False]")
Found 1 error in 1 file (checked 1 source file)
This may be reasonable opinionated behavior, but wanted to flag it as a behavior change between 0.770 and 0.780
I would personally consider this to be a false positive. It's not obvious how to change the source code to make mypy happy here.
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrongfalse-positivemypy gave an error on correct codemypy gave an error on correct codepriority-0-hightopic-literal-types