From c9892da871b5d5b1a3d1597af5a7953f0c243dd2 Mon Sep 17 00:00:00 2001 From: Nick Pope Date: Tue, 8 Jul 2025 09:33:14 +0100 Subject: [PATCH] perf: add `__slots__` to `SubtypeContext` Follow up to afd5a382dc95532da61e6ebc7002323fbca75548. --- mypy/subtypes.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/mypy/subtypes.py b/mypy/subtypes.py index 428e6dec6749..d7388e3bbdf5 100644 --- a/mypy/subtypes.py +++ b/mypy/subtypes.py @@ -89,6 +89,17 @@ class SubtypeContext: + __slots__ = ( + "ignore_type_params", + "ignore_pos_arg_names", + "ignore_declared_variance", + "always_covariant", + "ignore_promotions", + "erase_instances", + "keep_erased_types", + "options", + ) + def __init__( self, *,