Skip to content

Instantly share code, notes, and snippets.

@seozed
Created May 21, 2020 01:51
Show Gist options
  • Save seozed/908eab2c9395e3f2e9cbd02323bb2ef9 to your computer and use it in GitHub Desktop.
Save seozed/908eab2c9395e3f2e9cbd02323bb2ef9 to your computer and use it in GitHub Desktop.
快速声明一个装饰器
from functools import wraps
def timethis(func):
'''
Create a decorator .
'''
@wraps(func)
def wrapper(*args, **kwargs):
result = func(*args, **kwargs)
return result
return wrapper
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment