File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -617,7 +617,7 @@ def accept_loop(
617617 # If necessary, reset the modified options and make up for the postponed error checks:
618618 if warn_redundant :
619619 self .options .enabled_error_codes .add (codes .REDUNDANT_EXPR )
620- if self .options .warn_unreachable or warn_redundant :
620+ if self .options .warn_unreachable or warn_redundant or self . options . strict_equality :
621621 with self .binder .frame_context (can_skip = True , break_frame = 2 , continue_frame = 1 ):
622622 if on_enter_body is not None :
623623 on_enter_body ()
Original file line number Diff line number Diff line change @@ -519,6 +519,11 @@ if int() != str(): # E: Non-overlapping equality check (left operand type: "int
519519 pass
520520if int() is str(): # E: Non-overlapping identity check (left operand type: "int", right operand type: "str") [comparison-overlap]
521521 pass
522+
523+ x = int()
524+ while True:
525+ if x is str(): # E: Non-overlapping identity check (left operand type: "int", right operand type: "str") [comparison-overlap]
526+ pass
522527[builtins fixtures/primitives.pyi]
523528
524529[case testErrorCodeMissingModule]
You can’t perform that action at this time.
0 commit comments