From 6f09e44e5926ed3e041e96d9fb0b9b7eb66f2c4c Mon Sep 17 00:00:00 2001 From: Jukka Lehtosalo Date: Sat, 6 Nov 2021 14:49:34 +0000 Subject: [PATCH] Minor optimization/cleanup if TYPE_CHECKING is compiled inefficiently right now. --- mypy/types.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mypy/types.py b/mypy/types.py index e8651d6eba79c..354129d909f92 100644 --- a/mypy/types.py +++ b/mypy/types.py @@ -956,9 +956,7 @@ class FunctionLike(ProperType): def __init__(self, line: int = -1, column: int = -1) -> None: super().__init__(line, column) self.can_be_false = False - if TYPE_CHECKING: # we don't want a runtime None value - # Corresponding instance type (e.g. builtins.type) - self.fallback = cast(Instance, None) + self.fallback: Instance @abstractmethod def is_type_obj(self) -> bool: pass