Skip to content

Commit f2b855c

Browse files
explicit is None check for mypyc
1 parent ef22b69 commit f2b855c

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

mypy/join.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -799,9 +799,9 @@ def join_last_known_values(t: Instance, s: Instance) -> LiteralType | None:
799799
# drop last known value if they differ (e.g. join('x'?, 'y'?) -> str)
800800
left = t.last_known_value
801801
right = s.last_known_value
802-
if left == right:
803-
return left
804-
return None
802+
if left is None or right is None or left != right:
803+
return None
804+
return left
805805

806806

807807
def safe_join(t: Type, s: Type) -> Type:

0 commit comments

Comments
 (0)