flake8-unused-arguments
flake8-unused-arguments copied to clipboard
_ variable should be ignored
_ is a convention for variable that are not used afterwards.
I'm not taking about _* variables, only _ variables
So to be clear, you're saying functions like this?
def foo(a, b, c, _):
return a + b + c
More like
def foo(a, b, c):
_ = c
return a + b
_ should be ignored by default
To make sure I understand, in this case we’d ignore the assignment to _, so then the c argument would be reported unused. Is that the behavior you’d want?
I'm also in for def fn(a, b, c, _)
not reporting error on _
if anything, report a warning if it's actually being used
@FelipeLema that's a different request to what's being asked for here. What you're asking for is already supported - U101 is for unused arguments that start with an underscore, so you can simply start ignoring U101.
oh, I didn't know that... thanks for noting