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:

@boegel boegel changed the title CI: Enable flake8-comprehension and fix issues Enable flake8-comprehension code style check and fix issues Nov 19, 2025
@boegel boegel added this to the next release (5.2.0) milestone Nov 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants