Discuss / Python / 装饰器

装饰器

Topic source

def log1(func): def in_log1(): print('begin call') func() print('end call') return in_log1

@log1 def now(): print('dota') now()


  • 1

Reply