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

Function get_load_global_name

mypyc/transform/log_trace.py:46–57  ·  view source on GitHub ↗
(op: CallC)

Source from the content-addressed store, hash-verified

44
45
46def get_load_global_name(op: CallC) -> str | None:
47 name = op.function_name
48 if name == "CPyDict_GetItem":
49 arg = op.args[0]
50 if (
51 isinstance(arg, LoadStatic)
52 and arg.namespace == "static"
53 and arg.identifier == "globals"
54 and isinstance(op.args[1], LoadLiteral)
55 ):
56 return str(op.args[1].value)
57 return None
58
59
60# These primitives perform an implicit IncRef for the return value. Only some of the most common ones

Callers 1

visit_call_cMethod · 0.85

Calls 2

isinstanceFunction · 0.85
strClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…