# def sum(fn):
# def sun():
# print('我三sum')
# fn()
#
# return sun
#
#
# def a():
# print('我是a')
#
#
# a = sum(a)
# a()
# @函数名代表装饰器
# def sum(fn):
# def sun():
# print('我三sum')
# fn()
#
# return sun
#
#
# @sum
# def a():
# print('我是a')
#
#
# a()
#
# import time
#
#
# def get_time(fn):
# def inner():
# start = time.time()
# fn()
# end = time.time()
# print(end - start)
#
# return inner
#
#
# @get_time
# def func():
# for i in range(100000000):
# print(i)
#
#
# func()
# def aa(fn):
# def ac(a, b):
# return fn(a, b)
#
# return ac
#
#
# @aa
# def sun(a, b):
# s = a + b
# return s
#
#
# f = sun(1, 2)
# print(f)
def d(f):
print(f)
def a(fn):
def b():
print('fn调用')
fn()
return b
return a
@d('+')
def c():
print('111')
c()
发表评论