def LOAD_GLOBAL(ctx: _VSContext, instruction: dis.Instruction):
"""
Loads a global from `ctx.__globals__`.
"""
name = ctx.co_names[instruction.arg]
try:
item = ctx.get_global(name)
except KeyError:
# todo: safe_raise
return safe_raise(ctx, NameError("name '{}' is not defined".format(name)))
ctx.push(item)
return ctx
评论列表
文章目录