Whole file
bwhmather/ssort
The author described this change as “Fix lambda requirements with walrus operator”. It counts as a record because the check below fails on the code as it stood at 65c4b0a1f and passes on 1cfea30d0, with nothing else changed between the two runs.
Projectbwhmather/ssort
Fix saved2022-07-22
Sharing licenceMIT · LICENSE
Change size+1 −0
What the code was meant to do, written into the code itself as a save note
Fix lambda requirements with walrus operator
The change
| 161 | 161 | def _get_requirements_for_lambda(node: ast.Lambda) -> Iterable[Requirement]: | |
| 162 | 162 | yield from get_requirements(node.args) | |
| 163 | 163 | scope = _get_scope_from_arguments(node.args) | |
| 164 | + | scope.update(get_bindings(node.body)) | |
| 164 | 165 | for requirement in get_requirements(node.body): | |
| 165 | 166 | if requirement.name not in scope: | |
| 166 | 167 | yield requirement |
The check that tells the two apart
fail→pass·tests/test_requirements.py::test_lambda_requirements_walrus_operator
Check file tests/test_requirements.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 it65c4b0a1f2e9e93e65855967f9a438046b24d9e1
Broken version dated2022-05-16
Modulessort._requirements
Units changed_get_requirements_for_lambda
Fingerprint08f2aa55bee571d9
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
- 2021-08-08_get_bindings_for_named_expr
- 2021-04-06_get_bindings_for_import
- 2021-04-06_get_bindings_for_with
- 2021-03-29Fix dependencies being return for bindings in comprehensions