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

Function load_func

mypyc/irbuild/function.py:949–962  ·  view source on GitHub ↗
(builder: IRBuilder, func_name: str, fullname: str | None, line: int)

Source from the content-addressed store, hash-verified

947
948
949def load_func(builder: IRBuilder, func_name: str, fullname: str | None, line: int) -> Value:
950 if fullname and not fullname.startswith(builder.current_module):
951 # we're calling a function in a different module
952
953 # We can't use load_module_attr_by_fullname here because we need to load the function using
954 # func_name, not the name specified by fullname (which can be different for underscore
955 # function)
956 module = fullname.rsplit(".")[0]
957 loaded_module = builder.load_module(module)
958
959 func = builder.py_get_attr(loaded_module, func_name, line)
960 else:
961 func = builder.load_global_str(func_name, line)
962 return func
963
964
965def generate_singledispatch_dispatch_function(

Callers 1

Calls 5

rsplitMethod · 0.80
load_global_strMethod · 0.80
startswithMethod · 0.45
load_moduleMethod · 0.45
py_get_attrMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…