Skip to content

Instantly share code, notes, and snippets.

@adrianmarkperea
Last active October 19, 2019 03:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adrianmarkperea/617c7ef333e47df23823d7e99cd83557 to your computer and use it in GitHub Desktop.
Save adrianmarkperea/617c7ef333e47df23823d7e99cd83557 to your computer and use it in GitHub Desktop.
def debug_transformer(fun):
# Allow wrapper to receive arbitrary args
def wrapper(*args, **kwargs):
print(f'Function `{fun.__name__}` called')
# And pass it to the original function
res = fun(*args, **kwargs)
print(f'Function `{fun.__name__}` finished')
return res
return wrapper
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment