Skip to content

Instantly share code, notes, and snippets.

@scottt
Created April 28, 2013 12:14
Show Gist options
  • Save scottt/5476716 to your computer and use it in GitHub Desktop.
Save scottt/5476716 to your computer and use it in GitHub Desktop.
def f1(p=None):
def f2():
nonlocal p
if not p:
p = 'default'
print(p)
return f2
if __name__ == '__main__':
f1('test')()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment