Skip to content

Instantly share code, notes, and snippets.

@lykkin
Created June 23, 2016 20:33
Show Gist options
  • Save lykkin/cfae92c6ebc44deb9b5266dfc370f644 to your computer and use it in GitHub Desktop.
Save lykkin/cfae92c6ebc44deb9b5266dfc370f644 to your computer and use it in GitHub Desktop.
def log(f):
def logging_wrap(*args, **kwargs):
print 'init', args, kwargs
return f(*args, **kwargs)
return logging_wrap
@log
def test(*args):
return reduce(lambda a, b: a + b, args, 0)
test(1, 2, 3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment