Skip to content

Instantly share code, notes, and snippets.

@re4lfl0w
Last active December 17, 2021 01:34
Show Gist options
  • Save re4lfl0w/3a280a28a28350c92fa8df64d8aacd08 to your computer and use it in GitHub Desktop.
Save re4lfl0w/3a280a28a28350c92fa8df64d8aacd08 to your computer and use it in GitHub Desktop.
def dump_func_name(func):
def echo_func(*func_args, **func_kwargs):
print('')
print('Start func: {}'.format(func.__name__))
return func(*func_args, **func_kwargs)
return echo_func
class ClassName(object):
@dump_func_name
def add(self, a, b):
return a + b
c = ClassName()
c.add(3, 5)
# add
# 8
@ProsperousHeart
Copy link

Might want to consider functools.wraps

@re4lfl0w
Copy link
Author

Might want to consider functools.wraps

Thank you!

@ubeydtalha
Copy link

Thank you ^^ I need something like that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment