MCPcopy
hub / github.com/python/mypy / type_callable

Method type_callable

mypy/test/testtypes.py:1127–1133  ·  view source on GitHub ↗

type_callable(a1, ..., an, r) constructs a callable with argument types a1, ... an and return type r, and which represents a type.

(self, *a: Type)

Source from the content-addressed store, hash-verified

1125 return CallableType(list(a[:-1]), [ARG_POS] * n, [None] * n, a[-1], self.fx.function)
1126
1127 def type_callable(self, *a: Type) -> CallableType:
1128 """type_callable(a1, ..., an, r) constructs a callable with
1129 argument types a1, ... an and return type r, and which
1130 represents a type.
1131 """
1132 n = len(a) - 1
1133 return CallableType(list(a[:-1]), [ARG_POS] * n, [None] * n, a[-1], self.fx.type_type)
1134
1135
1136class MeetSuite(Suite):

Callers 1

Calls 3

CallableTypeClass · 0.90
lenFunction · 0.85
listClass · 0.85

Tested by

no test coverage detected