Discuss / Python / decorator

decorator

Topic source

贾会强63245

#12 Created at ... [Delete] [Delete and Lock User]

我就看这个他一本正经的胡说八道,py中不实现定义就使用肯定就报错,你观察下,其实只不过做到了函数的复用

hi 我觉得其实log 和 decroator 传的都是func, text = '' 这里可以赋任何值, 只是为了保证后面print('%s%s():' % (text, func.name)) 能输出来text的值


  • 1
  • 2

Reply