Last active
May 28, 2020 01:45
-
-
Save ducva/3ce360a23d5542a234488d8020280540 to your computer and use it in GitHub Desktop.
how to declare a decorator
This file contains hidden or 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 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