Skip to content

Commit

Permalink
Merge
Browse files Browse the repository at this point in the history
  • Loading branch information
sobolevn committed Aug 28, 2023
2 parents 93108fc + 30522e9 commit 1ddea5c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mypy/checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -5805,8 +5805,8 @@ def has_no_custom_eq_checks(t: Type) -> bool:
# Restrict the type of the variable to True-ish/False-ish in the if and else branches
# respectively
original_vartype = self.lookup_type(node)
if not in_boolean_context:
# We don't check `:=` values in expresions like `(a := A())`,
if in_boolean_context:
# We don't check `:=` values in expressions like `(a := A())`,
# because they produce two error messages.
self._check_for_truthy_type(original_vartype, node)
vartype = try_expanding_sum_type_to_union(original_vartype, "builtins.bool")
Expand Down

0 comments on commit 1ddea5c

Please sign in to comment.