Last active
October 19, 2019 03:41
-
-
Save adrianmarkperea/617c7ef333e47df23823d7e99cd83557 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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