Skip to content

Conversation

@Flamefire
Copy link
Contributor

@Flamefire Flamefire commented Nov 14, 2025

https://pypi.org/project/flake8-comprehensions/ has various useful checks, most importantly:

C419 Unnecessary list comprehension in <any/all>() prevents short-circuiting - rewrite as a generator.

I.e. things like any([expensive_check(x) for x in collection]) runs the check after processing the full collection instead of stopping after the first "match" which costs performance.

To me the whole collection of checks look useful for performance and readability so enable them all.

See easybuilders/easybuild-framework#5043

Requires:

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.

1 participant