By default, pylint v2.9.6 gives this warning:
spam.py
"""Docstring."""
def spam():
"""Docstring."""
spam = 42
return spam
pylint warning
spam.py|6 col 5 warning| [redefined-outer-name] Redefining name 'spam' from outer scope (line 4) [python/pylint]
After creating the following .pylintrc, the warning is no longer given. This is not desired.
.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=
Why?