NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #3540 most downloaded on PyPI
A flake8 plugin to help you write better list/set/dict comprehensions.
Last release 1 years ago
09 Sep 2025
Release timing varies
gaps range from 3 weeks to 12 months
Nearly every release is documented
notes for 42 of 42 stable releases
Nothing withdrawn
no release was ever pulled
10 years old
42 releases · first in 2016
* Support Python 3.14.
Support Python 3.14.
* Drop Python 3.8 support. * Support Python 3.13.
Drop Python 3.8 support.
Support Python 3.13.
Add rule C420 to check for dict comprehensions with constant values, encouraging replacement with dict.fromkeys().
One column per quarter.
Add rule C420 to check for dict comprehensions with constant values, encouraging replacement with dict.fromkeys().
Thanks to Tom Kuson in PR #553.
* Drop Python 3.7 support.
Drop Python 3.7 support.
* Support Python 3.12.
Support Python 3.12.
Add rule C418 to check for calls passing a dict literal or dict comprehension to dict().
Add rule C418 to check for calls passing a dict literal or dict comprehension to dict().
Add rule C419 to check for calls passing a list comprehension to any()/all().
Fix false positives in C406 “unnecessary dict literal”.
Fix false positives in C406 “unnecessary dict literal”.
Fixes Issue #260.
Expand C416 to dict comprehensions.
Expand C416 to dict comprehensions.
Thanks to Aaron Gokaslan in PR #490.
Fix false positive in rules C402 and C404 for dict() calls with keyword arguments.
Fix false positive in rules C402 and C404 for dict() calls with keyword arguments.
Thanks to Anders Kaseorg for the report in Issue #457.
Add rule C417 which recommends rewriting use of map() with lambda to an equivalent generator expression or comprehension.
Add rule C417 which recommends rewriting use of map() with lambda to an equivalent generator expression or comprehension.
Thanks to Tushar Sadhwani in PR #409.
* Support Python 3.11.
Support Python 3.11.
Remove upper bound on Flake8 version.
Drop Python 3.6 support.
Remove upper bound on Flake8 version.
* Support Flake8 4.
Support Flake8 4.
Fix type hint for tree argument.
Fix type hint for tree argument.
Thanks to kasium for the report in Issue #352.
* Add type hints.
Add type hints.
Stop distributing tests to reduce package size. Tests are not intended to be run outside of the tox setup in the repository. Repackagers can use GitHu
Support Python 3.10.
Stop distributing tests to reduce package size. Tests are not intended to be run outside of the tox setup in the repository. Repackagers can use GitHub's tarballs per tag.
Remove rules C407 (Unnecessary comprehension - can take a generator) and C412 (Unnecessary comprehension
Remove rules C407 (Unnecessary <dict/list> comprehension - <builtin> can take a generator) and C412 (Unnecessary <dict/list/set> comprehension - 'in' can take a generator). Both rules recommended increasing laziness, which is not always desirable and can lead to subtle bugs. Also, a fully exhausted generator is slower than an equivalent comprehension, so the advice did not always improve performance.
Thanks to David Smith, Dylan Young, and Leonidas Loucas for the report in Issue #247.
Improved installation instructions in README.
Drop Python 3.5 support.
Improved installation instructions in README.
Move license from ISC to MIT License.
Support Python 3.9.
Move license from ISC to MIT License.
Partially reverted the change to C408 to make it apply again to when dict is called with keyword arguments, e.g. dict(a=1, b=2) will be flagged to be rewritten in the literal form {"a": 1, "b": 2}
Made C408 only apply when no arguments are passed to dict/list/tuple.
Made C408 only apply when no arguments are passed to dict/list/tuple.
Remove check for dict comprehensions in rule C407 as it would also change the results for certain builtins such as sum().
Remove check for dict comprehensions in rule C407 as it would also change the results for certain builtins such as sum().
Remove check for set comprehensions in rule C407 as it would change the results for certain builtins such as sum().
Remove check for set comprehensions in rule C407 as it would change the results for certain builtins such as sum().
Add filter and map to rule C407.
Add filter and map to rule C407.
Check for dict and set comprehensions in rules C407 and C412.
Remove the tuple/unpacking check from C416 to prevent false positives where the type of the iterable is changed from some iterable to a tuple.
Remove the tuple/unpacking check from C416 to prevent false positives where the type of the iterable is changed from some iterable to a tuple.
Ensure the fix for false positives in C416 rule for asynchronous comprehensions runs on Python 3.6 too.
Ensure the fix for false positives in C416 rule for asynchronous comprehensions runs on Python 3.6 too.
Fix false positives in C416 rule for list comprehensions returning tuples.
Fix false positives in C416 rule for list comprehensions returning tuples.
Fix false positives in C416 rule for asynchronous comprehensions.
Fix false positives in C416 rule for asynchronous comprehensions.
Update Python support to 3.5-3.8.
Update Python support to 3.5-3.8.
Fix false positives for C404 for list comprehensions not directly creating tuples.
Add C413 rule that checks for unnecessary use of list() or reversed() around sorted().
list(), reversed(), sorted(), or tuple() within set or sorted()
list() or tuple() within list() or tuple()
set() within set
Add C415 rule that checks for unnecessary reversal of an iterable via subscript within reversed(), set(), or sorted().
Add C416 rule that checks for unnecessary list or set comprehensions that can be rewritten using list() or set().
Fix version display on flake8 --version (removing dependency on cached-property). Thanks to Jon Dufresne.
Fix version display on flake8 --version (removing dependency on cached-property). Thanks to Jon Dufresne.
Update Flake8 support to 3.0+ only. 3.0.0 was released in 2016 and the plugin hasn't been tested with it since.
Update Flake8 support to 3.0+ only. 3.0.0 was released in 2016 and the plugin hasn't been tested with it since.
Converted setuptools metadata to configuration file. This meant removing the __version__ attribute from the package. If you want to inspect the instal
Converted setuptools metadata to configuration file. This meant removing the __version__ attribute from the package. If you want to inspect the installed version, use importlib.metadata.version("flake8-comprehensions") (docs / backport).
Add dependencies on cached-property and importlib-metadata.
Fix false negatives in C407 for cases when enumerate and sum() are passed more than one argument.
Update Python support to 3.5-3.7, as 3.4 has reached its end of life.
Update Python support to 3.5-3.7, as 3.4 has reached its end of life.
C412 rule that complains about using list comprehension with in.
Add missing builtin enumerate to C407.
Add missing builtin enumerate to C407.
Drop Python 2 support, only Python 3.4+ is supported now.
Drop Python 2 support, only Python 3.4+ is supported now.
Fix false positives in C408 for calls using *args or kwargs.
Fix false positives in C408 for calls using *args or **kwargs.
Plugin now reserves the full C4XX code space rather than just C40X
Plugin now reserves the full C4XX code space rather than just C40X
C408 rule that complains about using tuple(), list(), or dict() instead of a literal.
C409 and C410 rules that complain about an unnecessary list or tuple that could be rewritten as a literal.
C411 rule that complains about using list comprehension inside a list() call.
Don't allow installation with Flake8 3.2.0 which doesn't enable the plugin. This bug was fixed in Flake8 3.2.1.
Don't allow installation with Flake8 3.2.0 which doesn't enable the plugin. This bug was fixed in Flake8 3.2.1.
Prevent false positives of C402 from generators of expressions that aren't two-tuples.
C405 and C406 now also complain about unnecessary tuple literals.
C407 rule that complains about unnecessary list comprehensions inside builtins that can work on generators.
C407 rule that complains about unnecessary list comprehensions inside builtins that can work on generators.
Split all rule codes by type. This allows granular selection of the rules in flake8 configuration.
Split all rule codes by type. This allows granular selection of the rules in flake8 configuration.
* Fix crash on method calls
Fix crash on method calls
C401 rule that complains about unnecessary list comprehensions inside calls to set() or dict().
C401 rule that complains about unnecessary list comprehensions inside calls to set() or dict().
C402 rule that complains about unnecessary list literals inside calls to set() or dict().
C400 rule that complains about an unnecessary usage of a generator when a list/set/dict comprehension would do.
C400 rule that complains about an unnecessary usage of a generator when a list/set/dict comprehension would do.
Your coding agent can read these notes before it upgrades. Set up the MCP server →