Created
August 10, 2021 08:52
-
-
Save syrte/3c1d0e20fff23b16a933a7bb26311b66 to your computer and use it in GitHub Desktop.
A decorator that does nothing.
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 null_decorator(*args, **kwargs): | |
"A decorator that does nothing." | |
if len(args) == 1 and len(kwargs) == 0 and callable(args[0]): | |
return args[0] | |
else: | |
return null_decorator |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment