From 1001d7fd54f32aedce9e478c16f1968b73c7618d Mon Sep 17 00:00:00 2001 From: Evgeniy Slobodkin Date: Fri, 26 Apr 2024 02:38:15 +0300 Subject: [PATCH] remove useless code --- mypy/constraints.py | 37 ------------------------------------- 1 file changed, 37 deletions(-) diff --git a/mypy/constraints.py b/mypy/constraints.py index 9ab2c21eebefa..bd9019591dfe4 100644 --- a/mypy/constraints.py +++ b/mypy/constraints.py @@ -17,9 +17,6 @@ CONTRAVARIANT, COVARIANT, ArgKind, - Block, - ClassDef, - SymbolTable, TypeInfo, ) from mypy.types import ( @@ -1336,40 +1333,6 @@ def visit_type_type(self, template: TypeType) -> list[Constraint]: else: return [] - def _make_type_info( - self, - name: str, - module_name: str | None = None, - mro: list[TypeInfo] | None = None, - bases: list[Instance] | None = None, - ) -> TypeInfo: - """Make a TypeInfo suitable for use in unit tests.""" - - class_def = ClassDef(name, Block([]), None, []) - class_def.fullname = name - - if module_name is None: - if "." in name: - module_name = name.rsplit(".", 1)[0] - else: - module_name = "__main__" - - info = TypeInfo(SymbolTable(), class_def, module_name) - if mro is None: - mro = [] - if name != "builtins.object": - mro.append(self.oi) - info.mro = [info] + mro - if bases is None: - if mro: - # By default, assume that there is a single non-generic base. - bases = [Instance(mro[0], [])] - else: - bases = [] - info.bases = bases - - return info - def neg_op(op: int) -> int: """Map SubtypeOf to SupertypeOf and vice versa."""