Skip to content

PLW3301 false positive if outer call has one argument and inner call has multiple arguments #16163

@dscorbett

Description

@dscorbett

Description

nested-min-max (PLW3301) has a false positive in Ruff 0.9.6 when the inner call is the outer call’s only argument and the inner call has multiple arguments.

$ cat >plw3301.py <<'# EOF'
print(min(min([2, 3], [4, 1])))
print(max(max([2, 4], [3, 1])))
# EOF

$ python plw3301.py
2
3

$ ruff --isolated check --select PLW3301 plw3301.py --unsafe-fixes --fix
Found 2 errors (2 fixed, 0 remaining).

$ python plw3301.py
[2, 3]
[3, 1]

This is similar to #4682, in which the inner call has only one argument.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedContributions especially welcomeruleImplementing or modifying a lint rule

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions