Skip to content

Commit 1f4e10e

Browse files
authored
Changes how errors are disabled in visit_comparison_expr (#11451)
It now has a better API for that. Change `copy()` -> `clean_copy()`.
1 parent cd75e5b commit 1f4e10e

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

mypy/checkexpr.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2230,10 +2230,15 @@ def visit_comparison_expr(self, e: ComparisonExpr) -> Type:
22302230

22312231
# Keep track of whether we get type check errors (these won't be reported, they
22322232
# are just to verify whether something is valid typing wise).
2233-
local_errors = self.msg.copy()
2234-
local_errors.disable_count = 0
2233+
local_errors = self.msg.clean_copy()
22352234
_, method_type = self.check_method_call_by_name(
2236-
'__contains__', right_type, [left], [ARG_POS], e, local_errors)
2235+
method='__contains__',
2236+
base_type=right_type,
2237+
args=[left],
2238+
arg_kinds=[ARG_POS],
2239+
context=e,
2240+
local_errors=local_errors,
2241+
)
22372242
sub_result = self.bool_type()
22382243
# Container item type for strict type overlap checks. Note: we need to only
22392244
# check for nominal type, because a usual "Unsupported operands for in"

0 commit comments

Comments
 (0)