We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 32f0502 commit 39cd8bcCopy full SHA for 39cd8bc
1 file changed
mypy/checker.py
@@ -6757,7 +6757,7 @@ def narrow_type_by_identity_equality(
6757
elif operator in {"==", "!="}:
6758
is_target_for_value_narrowing = is_singleton_equality_type
6759
6760
- should_coerce_literals = False
+ should_coerce_literals = True
6761
for i in expr_indices:
6762
typ = get_proper_type(operand_types[i])
6763
if is_literal_type_like(typ) or (isinstance(typ, Instance) and typ.type.is_enum):
0 commit comments