$npx skillfedfor your agent

flake8-comprehensions

A flake8 plugin to help you write better list/set/dict comprehensions.

Worth itPyPI Quality AssuranceReleased Sep 20251.9M downloads / moMITPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — flake8_comprehensions-3.17.0-py3-none-any.whl
v3.17.0 · released 2025-09-09 · Python >=3.9 · 1 runtime deps: flake8

Yes. The plugin is actively maintained, has no known vulnerabilities, and low install friction. It fills a specific and well-defined niche—catching comprehension anti-patterns—that most general linters do not cover. Install it if your team values code idiomaticity and performance-conscious Python style.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires Python 3.9 or later.
  • Low friction: a pure-Python wheel with only flake8 as a runtime dependency.
  • Actively maintained with a recent release and no known vulnerabilities.

License · maintenance · safety

MIT (permissive) — MIT license permits unrestricted use, modification, and distribution in both open-source and commercial projects.

last release 2025-09-09 (339 days) · last repo commit 2026-08-13 · 465 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,872,035 downloads/mo, #3,471 on PyPI

Verify before relying

pip install flake8-comprehensions

Then add C4 to flake8's select setting if defined, or it activates by default. Run flake8 on your code to see violations like C400-C417.
Same gist for agents: .md · .json

What it is and 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–C417) 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.

When 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—for 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.

Use it for

  • 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.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Worth it

Yes.

The plugin is actively maintained, has no known vulnerabilities, and low install friction. It fills a specific and well-defined niche—catching comprehension anti-patterns—that most general linters do not cover. Install it if your team values code idiomaticity and performance-conscious Python style.

Install

flake8-comprehensions on PyPI

Before you install

Low friction: a pure-Python wheel with only flake8 as a runtime dependency. Actively maintained with a recent release and no known vulnerabilities.

Requires Python 3.9 or later.

License in practice

MIT license permits unrestricted use, modification, and distribution in both open-source and commercial projects.

Quickstart

pip install flake8-comprehensions

Then add C4 to flake8's select setting if defined, or it activates by default. Run flake8 on your code to see violations like C400-C417.

Package facts

LicenseMIT permissive
Python supportSupports the current Python release >=3.9
Install frictionLow. Pure-Python wheel
Runtime dependencies
1 package
flake8
MaintenanceActively maintained 339 days since the last release
Last repo commit
First released
Downloads1,872,035 / month, #3,471 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 5 - Production/StableFramework :: Flake8Intended Audience :: DevelopersNatural Language :: EnglishProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Typing :: Typed

Evidence: flake8_comprehensions-3.17.0-py3-none-any.whl

Tags

Capabilities
flake8 comprehension lintinglist set dict comprehension checkerpython comprehension optimizationflake8 code quality plugindetect unnecessary generatorscomprehension best practicesflake8 performance linting
Topics
flake8-plugincode-stylelinting
PyPI keywords
comprehensionsdict comprehensionflake8list comprehensionset comprehension

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “flake8 comprehension linting”

Give your agent the search over MCP, or paste the wish link into any chat.

More Quality Assurance packages

coverage Worth it
PyPI · Testing · released Aug 2026

Coverage.py measures which lines of Python code are executed during test runs, reporting coverage percentages and identifying untested code paths.

Install it if you want to measure test completeness or enforce coverage thresholds in your project.

permissive licensepure Python · 3.10+
335.8Mdownloads / mo
ruff Worth it
PyPI · Python Modules · released Aug 2026

Ruff is a Python linter and code formatter written in Rust that combines linting, formatting, and code fixing into a single tool, replacing Flake8, Black, isort, and related utilities.

MITcompiled wheel · 3.7+
316.1Mdownloads / mo
pexpect With conditions
PyPI · Software Development · released Nov 2023

Pexpect spawns and controls interactive console applications by sending input and matching output patterns, automating tasks that would otherwise require manual interaction.

ISCpure Pythonaging
200.8Mdownloads / mo
black Worth it
PyPI · Python Modules · released May 2026

Black reformats Python source code to a consistent style by parsing entire files and rewriting them according to an opinionated, deterministic set of rules, eliminating manual formatting decisions.

MITpure Python · 3.10+
179.9Mdownloads / mo
pytest-xdist Worth it
PyPI · Utilities · released Jul 2025

pytest-xdist distributes pytest tests across multiple CPU cores or machines to speed up test execution, with the simplest usage being `pytest -n auto` to spawn workers equal to available CPUs.

Install it if your test suite takes long enough that parallelization would save meaningful time.

MITpure Python · 3.9+
177.1Mdownloads / mo
cfn-lint Worth it
PyPI · Quality Assurance · released Aug 2026

Validates AWS CloudFormation templates in YAML or JSON format against resource provider schemas and best practices, checking property values and configuration correctness.

Install it if you work with CloudFormation templates.

MIT-0pure Python
114.9Mdownloads / mo

See also flake8-pie · flake8-return · flake8-bugbear · flake8_simplify · flake8-tuple · flake8-tidy-imports · flake8-picky-parentheses · flake8-implicit-str-concat · flake8-commas · cython-lint