函数式编程可以配合装饰器使用
def outer(n):
"""思路不影响原来的函数情况下,用装饰器扩展"""
def inner(x,y):
list1 = []#
b = x + y
list1.append(b / 2)
print(list1)
return n(x,y)
return inner
@outer
def add(x,y):
return x + y
p = reduce(add,range(15))
if __name__ == "__main__":
print (p)