Commit 2e596d0
committed
chore: simplify redundant dict comprehensions (C416, C420)
Replace `{k: v for k in iter}` with `dict.fromkeys(iter, v)` (C420, 4x)
and `{k: v for k, v in zip(a, b)}` with `dict(zip(a, b))` (C416, 4x).
These are pure idiom cleanups flagged by ruff's flake8-comprehensions
rules. `dict.fromkeys` and `dict()` are marginally faster and more
readable, with identical behavior. Verified: same keys, same values,
same order.
Files touched:
- m_flow/eval/report.py
- m_flow/ingestion/documents/classify_documents.py
- m_flow/retrieval/episodic/bundle_search.py
- m_flow/retrieval/utils/fine_grained_triplet_search.py
- m_flow/retrieval/utils/procedural_bundle_search.py
- m_flow/tests/test_relational_db_migration.py1 parent 9df82e8 commit 2e596d0
6 files changed
Lines changed: 11 additions & 28 deletions
File tree
- m_flow
- eval
- ingestion/documents
- retrieval
- episodic
- utils
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
| 123 | + | |
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
60 | 43 | | |
61 | 44 | | |
62 | | - | |
| 45 | + | |
63 | 46 | | |
64 | 47 | | |
65 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
338 | 338 | | |
339 | 339 | | |
340 | 340 | | |
341 | | - | |
| 341 | + | |
342 | 342 | | |
343 | 343 | | |
344 | 344 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
255 | | - | |
| 255 | + | |
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
286 | 286 | | |
287 | 287 | | |
288 | 288 | | |
289 | | - | |
| 289 | + | |
290 | 290 | | |
291 | 291 | | |
292 | 292 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
0 commit comments