Skip to content

A006 and A002 both trigger for lambda's #14135

@jaap3

Description

@jaap3

This example triggers two violations (with preview enabled), is this intentional?

lambda id: id + 1
$ ruff check --isolated --preview --select A test.py

test.py:1:8: A002 Argument `id` is shadowing a Python builtin
  |
1 | lambda id: id + 1
  |        ^^ A002
  |

test.py:1:8: A006 Lambda argument `id` is shadowing a Python builtin
  |
1 | lambda id: id + 1
  |        ^^ A006
  |
$ ruff --version
ruff 0.7.2

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions