We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 84e8f1f commit 996e076Copy full SHA for 996e076
1 file changed
mypy/checker.py
@@ -6667,7 +6667,7 @@ def narrow_type_by_identity_equality(
6667
elif operator in {"==", "!="}:
6668
is_target_for_value_narrowing = is_singleton_equality_type
6669
6670
- should_coerce_literals = False
+ should_coerce_literals = True
6671
for i in expr_indices:
6672
typ = get_proper_type(operand_types[i])
6673
if is_literal_type_like(typ) or (isinstance(typ, Instance) and typ.type.is_enum):
0 commit comments