摘要: 1 第一种;未使用@符号 2 def a_new_decorator(a_func): # a_func = a_function_requiring_decoration 3 def wrapTheFunction(): 4 """the doc for wrapTheFunction""" 5 print("I am doing s... 阅读全文
posted @ 2018-08-10 17:35 哈喽哈喽111111 阅读(266) 评论(0) 推荐(0) 编辑
摘要: 1 Python 2.7中的继承 2 在Python 2.7中,继承语法稍有不同,ElectricCar 类的定义类似于下面这样: 3 class Car(object): 4 def __init__(self, make, model, year): 5 --snip-- 6 7 class ElectricCar(Car): 8 def _... 阅读全文
posted @ 2018-08-10 17:29 哈喽哈喽111111 阅读(1140) 评论(0) 推荐(0) 编辑