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

Method callable

mypy/test/testtypes.py:1120–1125  ·  view source on GitHub ↗

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

(self, *a: Type)

Source from the content-addressed store, hash-verified

1118 return Instance(self.fx.std_tuplei, [t])
1119
1120 def callable(self, *a: Type) -> CallableType:
1121 """callable(a1, ..., an, r) constructs a callable with argument types
1122 a1, ... an and return type r.
1123 """
1124 n = len(a) - 1
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

Calls 3

CallableTypeClass · 0.90
lenFunction · 0.85
listClass · 0.85

Tested by

no test coverage detected