2019年11月30日

python 装饰器

摘要: 装饰器的原理类似于以下函数 import time def func(): time.sleep(0.1) print('hello') def timer(f): def inner(): start=time.time() f() #被装饰的函数 end=time.time() print(en 阅读全文

posted @ 2019-11-30 21:09 -有风来 阅读(136) 评论(0) 推荐(0) 编辑

python 接口类、抽象类、多态

摘要: 参考https://www.cnblogs.com/Fantac/p/11481114.html 接口类和抽象类总结 在python中没有接口类,但有抽象类;abc模块中的metaclass = ABCMeta,@abstractmethod它的本质是做代码的规范用的,希望子类中能实现父类名字完全一 阅读全文

posted @ 2019-11-30 11:48 -有风来 阅读(222) 评论(0) 推荐(0) 编辑

导航