auth(auth_type): outer_wrapper(func): wrapper(*args, **kwargs): auth_type==: username = ().strip() password = ().strip() user == username passwd == password: () res = func(*args, **kwargs) res : () auth_type==: () wrapper outer_wrapper index(): () @(=) home(): () @(=) bbs(): () index() home() bbs()
装饰器
转载![](https://ucenter.51cto.com/images/noavatar_middle.gif)
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
常用的10个Python装饰器
python中常用的10个装饰器
python 装饰器 py装饰器