pycodestyle icon indicating copy to clipboard operation
pycodestyle copied to clipboard

E741: Inconsistent behavior for lambdas

Open knkski opened this issue 5 years ago • 3 comments

It seems like E741 shouldn't apply to variable names inside of comprehensions, due to the limited scope of such variables. If that's the desired behavior anyways, this behavior seems inconsistent to me:

# flagged as lint
foo = [l for l in lines if l]

# not flagged as lint
foo = list(filter(lambda l: l, lines))

knkski avatar Aug 12 '20 20:08 knkski