Flake8 plugin that helps you write better list/set/dict comprehensions
24.43 KB
built 2026-10-17 09:23:50 GMT
Description
A flake8 plugin to identify the following patterns:
- C400-402: Unnecessary generator - rewrite as a <list/set/dict> comprehension.
- C403-404: Unnecessary list comprehension - rewrite as a <set/dict>
comprehension.
- C405-406: Unnecessary <list/tuple> literal - rewrite as a <set/dict> literal.
- C408: Unnecessary <dict/list/tuple> call - rewrite as a literal.
- C409-410: Unnecessary <list/tuple> passed to <list/tuple>() - (remove the
outer call to <list/tuple>``()/rewrite as a ``<list/tuple> literal).
- C411: Unnecessary list call - remove the outer call to list().
- C412: Unnecessary <dict/list/set> comprehension - in can take a generator.
- C413: Unnecessary <list/reversed> call around sorted().
- C414: Unnecessary <list/reversed/set/sorted/tuple> call within
<list/set/sorted/tuple>().
- C415: Unnecessary subscript reversal of iterable within
<reversed/set/sorted>().
- C416: Unnecessary <list/set> comprehension - rewrite using <list/set>().
- C417: Unnecessary map usage - rewrite using a generator
expression/<list/set/dict> comprehension.
- C418: Unnecessary <dict/dict comprehension> passed to dict() - remove the
outer call to dict().
- C419 Unnecessary list comprehension in <any/all>() prevents short-
circuiting - rewrite as a generator.
- C420: Unnecessary dict comprehension - rewrite using dict.fromkeys().
Dependencies
13 totalRequires8
- ((python3.15dist(flake8) < 3.2 or python3.15dist(flake8) > 3.2) with python3.15dist(flake8) >= 3)
- python(abi) = 3.15
- rpmlib(CompressedFileNames) <= 3.0.4-1
- rpmlib(FileDigests) <= 4.6.0-1
- rpmlib(PartialHardlinkSets) <= 4.0.4-1
- rpmlib(PayloadFilesHavePrefix) <= 4.0-1
- rpmlib(PayloadIsZstd) <= 5.4.18-1
- rpmlib(RichDependencies) <= 4.12.0-1
Provides5
- python-flake8-comprehensions = 3.17.0-5.fc45
- python3-flake8-comprehensions = 3.17.0-5.fc45
- python3.15-flake8-comprehensions = 3.17.0-5.fc45
- python3.15dist(flake8-comprehensions) = 3.17
- python3dist(flake8-comprehensions) = 3.17
ObsoletesNo Obsoletes
ConflictsNo Conflicts
RecommendsNo Recommends
SuggestsNo Suggests
SupplementsNo Supplements
EnhancesNo Enhances
Files
17
Files 1–17 of 17
Component of
buildroots that installed this RPMNo Buildroots
