gpt4 book ai didi

python - 任何警告 var shadow 参数的 python linter

转载 作者:太空宇宙 更新时间:2023-11-03 12:05:08 24 4
gpt4 key购买 nike

pylint(1.5.2) 说“您的代码已被评为 10.00/10(上一次运行:10.00/10,+0.00)”,这绝对不是这样。有任何 lint 工具可以对此发出警告吗?

#!/usr/bin/env python2
# -*- coding: utf-8 -*-
'''test module'''


def test_fn(var_arg):
'''test_fn'''
for var_arg in [1, 2]:
print var_arg


def main():
'''main'''
test_fn(3)


if __name__ == "__main__":
main()

最佳答案

除了 pylint 之外,还有许多很棒的综合性 python linting 工具,您可能想看看:

此外,您应该查看此 SO 帖子 https://stackoverflow.com/a/7925369/4698963 中的一些 linter

关于python - 任何警告 var shadow 参数的 python linter,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34504082/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com