Skip to content

Instantly share code, notes, and snippets.

@j00bar
Created March 27, 2015 00:16
Show Gist options
  • Select an option

  • Save j00bar/6966ff758c646fe0d69a to your computer and use it in GitHub Desktop.

Select an option

Save j00bar/6966ff758c646fe0d69a to your computer and use it in GitHub Desktop.
def g():
x = 1
def f():
return x * 2
return f
f = g()
# How can I, from only having a reference to f, access the value of x from the local context of the call to g() that created f?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment