Skip to content

Instantly share code, notes, and snippets.

@jseakle
Last active October 7, 2019 16:03
Show Gist options
  • Save jseakle/05c4b0b65d5d5ea0dc3b7801b33463b4 to your computer and use it in GitHub Desktop.
Save jseakle/05c4b0b65d5d5ea0dc3b7801b33463b4 to your computer and use it in GitHub Desktop.
# python2.7
def foo():
#exec "" # uncomment to make this work, see https://stackoverflow.com/a/8028785/314922
defaults = {
'what': None,
}
locals().update(defaults)
print what
#what = 5 # uncomment to break it again
foo()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment