首页 > 编程语言 > 详细

python-装饰器

时间:2019-07-26 19:16:21      阅读:90      评论:0      收藏:0      [点我收藏+]

格式:

@decorator(arg1, arg2)    # 参数可有可无
def fun():
    pass

 等价于:

def fun():
    pass
fun = decorator(arg1, arg2)(fun)

 

python-装饰器

原文:https://www.cnblogs.com/wang-mengmeng/p/11251949.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!