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

Function _apply_specialization

mypyc/irbuild/specialize.py:189–202  ·  view source on GitHub ↗
(
    builder: IRBuilder, expr: CallExpr, callee: RefExpr, name: str | None, typ: RType | None = None
)

Source from the content-addressed store, hash-verified

187
188
189def _apply_specialization(
190 builder: IRBuilder, expr: CallExpr, callee: RefExpr, name: str | None, typ: RType | None = None
191) -> Value | None:
192 # TODO: Allow special cases to have default args or named args. Currently they don't since
193 # they check that everything in arg_kinds is ARG_POS.
194
195 # If there is a specializer for this function, try calling it.
196 # Return the first successful one.
197 if name and (name, typ) in specializers:
198 for specializer in specializers[name, typ]:
199 val = specializer(builder, expr, callee)
200 if val is not None:
201 return val
202 return None
203
204
205def apply_function_specialization(

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…