MCPcopy Index your code
hub / github.com/python/mypy / make_overload

Method make_overload

mypy/test/testtypes.py:1579–1594  ·  view source on GitHub ↗
(self, items: list[list[tuple[str, Type, ArgKind]]])

Source from the content-addressed store, hash-verified

1577 assert ov.items.index(c) == expected_index
1578
1579 def make_overload(self, items: list[list[tuple[str, Type, ArgKind]]]) -> Overloaded:
1580 result = []
1581 for item in items:
1582 arg_types = []
1583 arg_names = []
1584 arg_kinds = []
1585 for name, typ, kind in item:
1586 arg_names.append(name)
1587 arg_types.append(typ)
1588 arg_kinds.append(kind)
1589 result.append(
1590 CallableType(
1591 arg_types, arg_kinds, arg_names, ret_type=NoneType(), fallback=self.fx.o
1592 )
1593 )
1594 return Overloaded(result)
1595
1596
1597def make_call(*items: tuple[str, str | None]) -> CallExpr:

Callers 5

test_simpleMethod · 0.95
test_optional_argMethod · 0.95
test_two_argsMethod · 0.95

Calls 4

CallableTypeClass · 0.90
NoneTypeClass · 0.90
OverloadedClass · 0.90
appendMethod · 0.80

Tested by

no test coverage detected