f start...
2015-3-25
f end...
2015-3-25
Traceback (most recent call last):
File "d:\hello.py", line 37, in <module>
@log('execute')
^^^^^^^^^^^^^^
File "d:\hello.py", line 8, in wrapper
print('%s start...'%func.__name__)
^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute '__name__'. Did you mean: '__ne__'?
juven永恒
而如果我这么写
就会报错
如果这样写
就没问题。那能不能认为log方法里那个if和else各针对了一种情况,但我记得None和字符串都不是callable的吧?