小编mic*_*uhu的帖子

检查返回是否不是 None

在 python3 中执行此操作是否有效?

if request_link(requested_domain, requested_link) is not None
    domain_res, link_res, r_res = request_link(requested_domain, requested_link)
    parse_results(domain_res, r_res)
Run Code Online (Sandbox Code Playgroud)

这是否意味着解释器将两次查看同一个函数?

有效率吗?如果没有,检查函数是否不返回并根据结果采取行动的更好方法是什么?

谢谢你!

python if-statement return python-3.x nonetype

5
推荐指数
1
解决办法
2万
查看次数

标签 统计

if-statement ×1

nonetype ×1

python ×1

python-3.x ×1

return ×1