Skip to content

Commit

Permalink
remove useless code
Browse files Browse the repository at this point in the history
  • Loading branch information
sloboegen committed Apr 25, 2024
1 parent 689bc95 commit 1001d7f
Showing 1 changed file with 0 additions and 37 deletions.
37 changes: 0 additions & 37 deletions mypy/constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
CONTRAVARIANT,
COVARIANT,
ArgKind,
Block,
ClassDef,
SymbolTable,
TypeInfo,
)
from mypy.types import (
Expand Down Expand Up @@ -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."""
Expand Down

0 comments on commit 1001d7f

Please sign in to comment.