If I had read the error message more carefully, I would have realized that I was no longer getting an unused variable warning, but a warning about a bad variable name. In other words, something like this would be fine:
for _unused in range(10):
print 'hello world'
This is okay since it matches the regular expression in variable-rgx
. However, the original form
for _ in range(10):
print 'hello world'
does not work since _
does not match the value of variable-rgx
. In order to have no warnings for this unused and invalid variable name, the name needs to be added to the list of white-listed names in good-names
. Once this is done, no more warnings will be generated.