Skip to content

Commit cea2af9

Browse files
rewrote ternary statement as separate returns for mypyc
1 parent 377a0af commit cea2af9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

mypy/join.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -799,7 +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-
return left if left == right else None
802+
if left == right:
803+
return left
804+
return None
803805

804806

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

0 commit comments

Comments
 (0)