Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False positive R1730 consider-using-min-builtin, R1731 consider-using-max-builtin #9800

Closed
bebound opened this issue Jul 16, 2024 · 0 comments · Fixed by #9802
Closed

False positive R1730 consider-using-min-builtin, R1731 consider-using-max-builtin #9800

bebound opened this issue Jul 16, 2024 · 0 comments · Fixed by #9802
Labels
False Positive 🦟 A message is emitted but nothing is wrong with the code Help wanted 🙏 Outside help would be appreciated, good for new contributors Needs PR This issue is accepted, sufficiently specified and now needs an implementation

Comments

@bebound
Copy link

bebound commented Jul 16, 2024

Bug description

The errors should not be raised.

def kk(instance,count):
    if count>0:
        instance.count=count
    return instance

def kk2(instance,count):
    if count<0:
        instance.count=count
    return instance

Configuration

No response

Command used

pylint --disable=C0114,C0116

Pylint output

test.py:2:4: R1730: Consider using 'count = min(count, count)' instead of unnecessary if block (consider-using-min-builtin)
test.py:7:4: R1731: Consider using 'count = max(count, count)' instead of unnecessary if block (consider-using-max-builtin)

Expected behavior

No warning

Pylint version

pylint 3.2.5
astroid 3.2.3
Python 3.10.12 (main, Mar 22 2024, 16:50:05) [GCC 11.4.0]

OS / Environment

Ubuntu 22.04

Additional dependencies

No response

@bebound bebound added the Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling label Jul 16, 2024
@DanielNoord DanielNoord added Help wanted 🙏 Outside help would be appreciated, good for new contributors Needs PR This issue is accepted, sufficiently specified and now needs an implementation False Positive 🦟 A message is emitted but nothing is wrong with the code and removed Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling labels Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
False Positive 🦟 A message is emitted but nothing is wrong with the code Help wanted 🙏 Outside help would be appreciated, good for new contributors Needs PR This issue is accepted, sufficiently specified and now needs an implementation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants