Skip to content

Instantly share code, notes, and snippets.

@syrte
Created August 10, 2021 08:52
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 syrte/3c1d0e20fff23b16a933a7bb26311b66 to your computer and use it in GitHub Desktop.
Save syrte/3c1d0e20fff23b16a933a7bb26311b66 to your computer and use it in GitHub Desktop.
A decorator that does nothing.
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