{"categories":[{"label":"Quality Assurance","url":"https://skillfed.io/packages/category/software-development-quality-assurance"}],"enrichment":{"capability":"A flake8 plugin that detects and suggests rewrites for inefficient or redundant list, set, and dict comprehensions and related constructs.","skillfed_tags":["flake8-plugin","code-style","linting"],"use_cases":["Enforce consistent comprehension style across a team codebase during CI/CD linting.","Catch performance anti-patterns like unnecessary generator wrapping or double-casting in code review.","Teach Python developers idiomatic comprehension syntax and when to use set/dict literals.","Identify redundant list comprehensions that can be simplified to direct set() or dict() calls.","Flag inefficient sorted() or reversed() patterns that can be optimized with built-in arguments."],"what_it_does":"flake8-comprehensions is a flake8 plugin that analyzes Python code to identify and flag inefficient or redundant patterns involving comprehensions, generators, and built-in type constructors. It enforces a suite of rules (C400\u2013C417) that catch common mistakes: unnecessary generator expressions wrapped in list/set/dict calls, list comprehensions passed to set/dict constructors, redundant literal syntax, and inefficient double-casting of iterables. The plugin integrates directly into flake8's linting pipeline.\n\nWhen installed, it runs automatically as part of flake8's checks (unless explicitly disabled via configuration). It emits specific error codes and suggestions for how to rewrite each pattern more idiomatically\u2014for example, replacing `list(x for x in foo)` with `[x for x in foo]` or `set([1, 2])` with `{1, 2}`. The plugin is particularly useful in codebases that prioritize readability and performance, helping developers adopt Pythonic idioms consistently.","worth_installing":"Yes. The plugin is actively maintained, has no known vulnerabilities, and low install friction. It fills a specific and well-defined niche\u2014catching comprehension anti-patterns\u2014that most general linters do not cover. Install it if your team values code idiomaticity and performance-conscious Python style."},"id":"flake8-comprehensions","links":{"html":"https://skillfed.io/packages/flake8-comprehensions","md":"https://skillfed.io/packages/flake8-comprehensions.md","pypi":"https://pypi.org/project/flake8-comprehensions/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2025-09-09","license_spdx":"MIT","license_treatment":"permissive","name":"flake8-comprehensions","python_support":"supports_current","summary":"A flake8 plugin to help you write better list/set/dict comprehensions."},"popularity":{"monthly_downloads":1872035,"position":3471,"tier":"top_5000"},"security":{"n_vulnerabilities":0},"version":"3.17.0"}
