Skip to content

Instantly share code, notes, and snippets.

@ironfroggy
Created October 6, 2009 16:00
Show Gist options
  • Save ironfroggy/203158 to your computer and use it in GitHub Desktop.
Save ironfroggy/203158 to your computer and use it in GitHub Desktop.
def attrs(**kwargs):
def _(f):
for (k, v) in kwargs.items():
setattr(f, k, v)
return f
return _
@attrs(author="ironfroggy")
def foo():
print foo.author
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment