Skip to content

Instantly share code, notes, and snippets.

@ducva
Last active May 28, 2020 01:45
Show Gist options
  • Save ducva/3ce360a23d5542a234488d8020280540 to your computer and use it in GitHub Desktop.
Save ducva/3ce360a23d5542a234488d8020280540 to your computer and use it in GitHub Desktop.
how to declare a decorator
def authed(func):
def auth_check(*args, **kwargs):
print("checking authentication")
func(*args, **kwargs)
print("post-process")
return auth_check
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment