Whole file
mrmaxguns/wonderwordsmodule
The author described this change as “fix: sorted filter, which also ensures determinism #17”. It counts as a record because the check below fails on the code as it stood at 199c68f81 and passes on 46bd65751, with nothing else changed between the two runs.
Projectmrmaxguns/wonderwordsmodule
Fix saved2024-04-12
Sharing licenceMIT · LICENSE
Change size+3 −3
What the code was meant to do, written into the code itself as a save note
fix: sorted filter, which also ensures determinism #17
The change
| 220 | 220 | regex: Optional[str] = None, | |
| 221 | 221 | exclude_with_spaces: bool = False, | |
| 222 | 222 | ) -> WordList: | |
| 223 | - | """Return all existing words that match the criteria specified by the | |
| 224 | - | arguments. | |
| 223 | + | """Return a sorted list of all existing words that match the criteria | |
| 224 | + | specified by the arguments. | |
| 225 | 225 | ||
| 226 | 226 | Example:: | |
| 227 | 227 | ||
| ⋯ | |||
| 332 | 332 | if long_operations: | |
| 333 | 333 | words -= self._perform_long_operations(words, long_operations) | |
| 334 | 334 | ||
| 335 | - | return list(words) | |
| 335 | + | return sorted(list(words)) | |
| 336 | 336 | ||
| 337 | 337 | def random_words( | |
| 338 | 338 | self, | |
The check that tells the two apart
fail→pass·tests/test_random_word.py::TestRandomWord::test_filter_sorting
Check file tests/test_random_word.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 it199c68f81506b316ac744c2aee4432204a2ea6d4
Broken version dated2024-04-12
Modulewonderwords.random_word
Units changedRandomWord
Fingerprint04a365ae38c3df03
Checked2026-08-18 by goldset/0.1
Every field above is generated by our program. None of it is written by hand.