Discuss / Python / 'end call'直接加在return后面

'end call'直接加在return后面

Topic source

看了下评论,大家基本上都是采用一个中间函数,先打印'begin call'和'end call',然后再return,试了下,直接把print加在return后面也可以。

print('begin call %s()' % func.name) return func(args, *kw), print('end call %s()' % func.name)

JOIEUH

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

我想不明白,为什么你用第三方变量,不是应该先把begin,和end答应了之后,再返回吗? 那么为什么函数的会跑到他们中间去了呢? 应该在最后面的


  • 1

Reply