默认情况下,pylint v2.9.6会给出以下警告:
spam.py
"""Docstring."""
def spam():
"""Docstring."""
spam = 42
return spam
pylint警告
spam.py|6 col 5 warning| [redefined-outer-name] Redefining name 'spam' from outer scope (line 4) [python/pylint]
创建以下.pylintrc后,不再给出警告。这是不可取的
.pylintrc(possible locations)
[VARIABLES]
# A regular expression matching the name of dummy variables (i.e. expected to
# not be used).
#dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_
dummy-variables-rgx=
为什么?
目前没有回答
相关问题 更多 >
编程相关推荐