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

Two more flake8-boolean-trap FBT003 false positives #1336

Closed
rhkleijn opened this issue Dec 22, 2022 · 1 comment · Fixed by #1338
Closed

Two more flake8-boolean-trap FBT003 false positives #1336

rhkleijn opened this issue Dec 22, 2022 · 1 comment · Fixed by #1338
Assignees

Comments

@rhkleijn
Copy link

I highly appreciate your amazing work on ruff!

I noticed your recent PR #1333 . In my code base I encountered two more flake8-boolean-trap FBT003 false positives for getattr and for the index method of list, tuple and other Sequences. E.g.

getattr(someobj, attrname, False)  # return False if `attrname` is not found on `someobj`
mylist.index(True)  # find index of first occurrence of True

It would be great to get rid of some # noqa: FBT003 comments for these cases.

@charliermarsh
Copy link
Member

Will add!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants