Skip to content

Commit ccd5179

Browse files
committed
--strict-equality for None
I'm curious to see what the Mypy primer thinks of it...
1 parent 116b92b commit ccd5179

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mypy/checkexpr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3817,7 +3817,7 @@ def dangerous_comparison(
38173817
#
38183818
# TODO: find a way of disabling the check only for types resulted from the expansion.
38193819
return False
3820-
if isinstance(left, NoneType) or isinstance(right, NoneType):
3820+
if isinstance(left, NoneType) and isinstance(right, NoneType):
38213821
return False
38223822
if isinstance(left, UnionType) and isinstance(right, UnionType):
38233823
left = remove_optional(left)

0 commit comments

Comments
 (0)