Skip to content

Instantly share code, notes, and snippets.

@wilig
Forked from inklesspen/gist:270809
Created January 6, 2010 23:36
Show Gist options
  • Save wilig/270811 to your computer and use it in GitHub Desktop.
Save wilig/270811 to your computer and use it in GitHub Desktop.
from decorator import decorator
import inspect
@decorator
def deco(f, *a, **kw):
# set a default keyword arg
if 'foo' not in kw:
kw['foo'] = 'bar'
return f(*a, **kw)
def f(a, b, foo='bleh', foo2='help'):
pass
f1 = deco(f)
print inspect.getargspec(f)
print inspect.getargspec(f1)
f1(1,2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment