Skip to content

Commit de23d08

Browse files
authored
Subtype checking micro-optimization (#19384)
1 parent 4980ae5 commit de23d08

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

mypy/subtypes.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -155,15 +155,13 @@ def is_subtype(
155155
options=options,
156156
)
157157
else:
158-
assert not any(
159-
{
160-
ignore_type_params,
161-
ignore_pos_arg_names,
162-
ignore_declared_variance,
163-
always_covariant,
164-
ignore_promotions,
165-
options,
166-
}
158+
assert (
159+
not ignore_type_params
160+
and not ignore_pos_arg_names
161+
and not ignore_declared_variance
162+
and not always_covariant
163+
and not ignore_promotions
164+
and options is None
167165
), "Don't pass both context and individual flags"
168166
if type_state.is_assumed_subtype(left, right):
169167
return True

0 commit comments

Comments
 (0)