为什么函数对象在python中评估为True?
发布于 2021-01-29 15:04:40
在python中进行如下构造是有效的:
def a():
return 0
if a:
print "Function object was considered True"
else:
print "Function object was considered False"
我想问一个函数指针被评估为True的逻辑是什么。
为什么在语言中插入这种构造?
关注者
0
被浏览
96