Skip to content

PLR1730 more aggressive with pylint 3.1.0 #10907

@xrmx

Description

@xrmx

With the following snippet:

class Foo:
    _min = 0

    def foo(self, value):
        if value < self._min:
            self._min = value                             

pylint 3.1.0 returns:

foo.py:6:8: R1730: Consider using '_min = min(_min, value)' instead of unnecessary if block (consider-using-min-builtin)

ruff 0.3.7 does not report it. pylint 3.0.2 did not report it too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help 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