Skip to content

Commit a3dac67

Browse files
committed
Micro-optimization: Avoid temporary set creation is_proper_subtype
This is a part of a set of micro-optimizations that improve self check performance by ~5.5%.
1 parent 02a472a commit a3dac67

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
@@ -213,8 +213,8 @@ def is_proper_subtype(
213213
keep_erased_types=keep_erased_types,
214214
)
215215
else:
216-
assert not any(
217-
{ignore_promotions, erase_instances, keep_erased_types}
216+
assert (
217+
not ignore_promotions and not erase_instances and not keep_erased_types
218218
), "Don't pass both context and individual flags"
219219
if type_state.is_assumed_proper_subtype(left, right):
220220
return True

0 commit comments

Comments
 (0)