Skip to content

Conversation

dosisod
Copy link
Contributor

@dosisod dosisod commented Mar 15, 2023

This PR removes certain len() comparisons when it would be faster/more succinct to do a truthy check instead, such as len(x) == 0 vs not x.

This fixes the FURB115 errors in Refurb (see #14887).

This PR removes certain `len()` comparisons when it would be faster/more
succinct to do a truthy check instead, such as `len(x) == 0` vs `not x`.

See python#14887
Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of these are great, but some of them make the code less readable imo

@github-actions

This comment has been minimized.

Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@github-actions
Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@hauntsaninja hauntsaninja merged commit 46ab0f8 into python:master Mar 25, 2023
@dosisod dosisod deleted the cleanup-furb115 branch March 26, 2023 00:05
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 this pull request may close these issues.

3 participants