Skip to content

Instantly share code, notes, and snippets.

@pahaz
Last active March 25, 2016 13:42
Show Gist options
  • Save pahaz/1647fb566be48a0d5be1 to your computer and use it in GitHub Desktop.
Save pahaz/1647fb566be48a0d5be1 to your computer and use it in GitHub Desktop.
def logg(func):
def logged_func(*args, **kwargs):
print(func.__name__ + '() ...',
args, kwargs)
return func(*args, **kwargs)
logged_func.__doc__ = func.__doc__
logged_func.__name__ = func.__name__
return logged_func
@logg
def print_square_sum(*args):
"""Docs"""
_sum = sum(args)
print(str(_sum ** 2) + ' ...!!', args)
@logg
def some1():
"""some1 docs"""
pass
some1()
print_square_sum(2, 1, 2)
print(some1.__doc__, some1.__name__)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment