Skip to content

PLW3301: min/max false positive with iterables #4682

@lovetox

Description

@lovetox

ruff: 0.0.267

tuples_list = [
    (1, 2),
    (2, 3),
    (3, 4),
    (4, 5),
    (5, 6),
]

max(max(tuples_list))

This raises PLW3301 [*] Nested max calls can be flattened

i don’t see how this can be flattend, if you only call max() once, it will return a tuple instead of the integer

Metadata

Metadata

Assignees

No one assigned

    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