[Disclaimer: there may be more pythonic ways of doing what I want to do, but I want to know how python\'s scoping works here]
I\'m trying to find a way to make a dec
Update __globals__ works for me.
__globals__
def f(): print(a) def with_context(**kw): def deco(fn): g = fn.__globals__ g.update(kw) return fn return deco with_context(a=3)(f)() # 3