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

Function add_register_method_to_callable_class

mypyc/irbuild/function.py:1110–1116  ·  view source on GitHub ↗
(builder: IRBuilder, fn_info: FuncInfo)

Source from the content-addressed store, hash-verified

1108
1109
1110def add_register_method_to_callable_class(builder: IRBuilder, fn_info: FuncInfo) -> None:
1111 line = fn_info.fitem.line
1112 with builder.enter_method(fn_info.callable_class.ir, "register", object_rprimitive):
1113 cls_arg = builder.add_argument("cls", object_rprimitive)
1114 func_arg = builder.add_argument("func", object_rprimitive, ArgKind.ARG_OPT)
1115 ret_val = builder.call_c(register_function, [builder.self(), cls_arg, func_arg], line)
1116 builder.add(Return(ret_val, line))
1117
1118
1119def load_singledispatch_registry(builder: IRBuilder, dispatch_func_obj: Value, line: int) -> Value:

Callers 1

gen_dispatch_func_irFunction · 0.85

Calls 6

ReturnClass · 0.90
add_argumentMethod · 0.80
enter_methodMethod · 0.45
call_cMethod · 0.45
selfMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…