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.

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

525525 bindings = set(get_bindings(node))
526526
527527 for dependency in dependencies:
528- if dependency not in bindings:
528+ if dependency.name not in bindings:
529529 yield dependency
530530
531531
548548 bindings = set(get_bindings(node))
549549
550550 for dependency in dependencies:
551- if dependency not in bindings:
551+ if dependency.name not in bindings:
552552 yield dependency
553553
554554
572572 bindings = set(get_bindings(node))
573573
574574 for dependency in dependencies:
575- if dependency not in bindings:
575+ if dependency.name not in bindings:
576576 yield dependency
577577
578578
595595 bindings = set(get_bindings(node))
596596
597597 for dependency in dependencies:
598- if dependency not in bindings:
598+ if dependency.name not in bindings:
599599 yield dependency
600600
601601

The check that tells the two apart

failpass·tests/test_dependencies.py::test_dict_comp_dependencies
failpass·tests/test_dependencies.py::test_list_comp_dependencies
failpass·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