Whole file
bwhmather/ssort
The author described this change as “Fix dependencies being return for bindings in comprehensions”. It counts as a record because the checks below fail on the code as it stood at 8d64e001d and pass on b3054f643, with nothing else changed between the two runs.
Projectbwhmather/ssort
Fix saved2021-03-29
Sharing licenceMIT · LICENSE
Change size+4 −4
What the code was meant to do, written into the code itself as a save note
Fix dependencies being return for bindings in comprehensions
The change
| 525 | 525 | bindings = set(get_bindings(node)) | |
| 526 | 526 | ||
| 527 | 527 | for dependency in dependencies: | |
| 528 | - | if dependency not in bindings: | |
| 528 | + | if dependency.name not in bindings: | |
| 529 | 529 | yield dependency | |
| 530 | 530 | ||
| 531 | 531 | ||
| ⋯ | |||
| 548 | 548 | bindings = set(get_bindings(node)) | |
| 549 | 549 | ||
| 550 | 550 | for dependency in dependencies: | |
| 551 | - | if dependency not in bindings: | |
| 551 | + | if dependency.name not in bindings: | |
| 552 | 552 | yield dependency | |
| 553 | 553 | ||
| 554 | 554 | ||
| ⋯ | |||
| 572 | 572 | bindings = set(get_bindings(node)) | |
| 573 | 573 | ||
| 574 | 574 | for dependency in dependencies: | |
| 575 | - | if dependency not in bindings: | |
| 575 | + | if dependency.name not in bindings: | |
| 576 | 576 | yield dependency | |
| 577 | 577 | ||
| 578 | 578 | ||
| ⋯ | |||
| 595 | 595 | bindings = set(get_bindings(node)) | |
| 596 | 596 | ||
| 597 | 597 | for dependency in dependencies: | |
| 598 | - | if dependency not in bindings: | |
| 598 | + | if dependency.name not in bindings: | |
| 599 | 599 | yield dependency | |
| 600 | 600 | ||
| 601 | 601 | ||
The check that tells the two apart
fail→pass·tests/test_dependencies.py::test_dict_comp_dependencies
fail→pass·tests/test_dependencies.py::test_list_comp_dependencies
fail→pass·tests/test_dependencies.py::test_set_comp_dependencies
Check file tests/test_dependencies.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.
Origin and history
The code before it8d64e001d325d382ecdd5feffce115e093e7fb20
Broken version dated2021-03-29
Modulessort._dependencies
Units changed_get_dependencies_for_dict_comp, _get_dependencies_for_generator_exp, _get_dependencies_for_list_comp, _get_dependencies_for_set_comp
Fingerprint7d28ed438706b066
Checked2026-08-18 by goldset/0.1
Every field above is generated by our program. None of it is written by hand.
Other bugs found in bwhmather/ssort
- 2026-08-03Fix handling of nested classes
- 2024-01-18Fix detection of self argument name when positional-only
- 2022-07-22Fix lambda requirements with walrus operator
- 2021-08-08_get_bindings_for_named_expr
- 2021-04-06_get_bindings_for_import
- 2021-04-06_get_bindings_for_with