我需要找到从inner_function_nonlocal()引用变量x = "Nonlocal"的方法。请注意:我不能为了编写nonlocal x而注释或删除x = "Local"。x = "Global"
x = "Nonlocal"
def inner_function_global():_) # <- What should I specify here
示例: # How do I implement this?return varname not in frame.f_locals # This does NOT work
x = 1 nonlocalx assert is_nonlocal(inspect.currentframe(), 'x')