Skip to content

Commit ca738e5

Browse files
authored
Micro-optimization: Avoid temporary set creation in is_proper_subtype (#19463)
This was suggested by @sterliakov in #19384 (comment) This is a part of a set of micro-optimizations that improve self check performance by ~5.5%.
1 parent 6f7d716 commit ca738e5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mypy/subtypes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,8 @@ def is_proper_subtype(
217217
keep_erased_types=keep_erased_types,
218218
)
219219
else:
220-
assert not any(
221-
{ignore_promotions, erase_instances, keep_erased_types}
220+
assert (
221+
not ignore_promotions and not erase_instances and not keep_erased_types
222222
), "Don't pass both context and individual flags"
223223
if type_state.is_assumed_proper_subtype(left, right):
224224
return True

0 commit comments

Comments
 (0)