Skip to content

Instantly share code, notes, and snippets.

@inklesspen
Created January 6, 2010 23:34
Show Gist options
  • Save inklesspen/270809 to your computer and use it in GitHub Desktop.
Save inklesspen/270809 to your computer and use it in GitHub Desktop.
@decorator
def deco(f, *a, **kw):
# set a default keyword arg
if 'foo' not in kw:
kw['foo'] = 'bar'
return f(*a, **kw)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment