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.

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

220220 regex: Optional[str] = None,
221221 exclude_with_spaces: bool = False,
222222 ) -> 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.
225225
226226 Example::
227227
332332 if long_operations:
333333 words -= self._perform_long_operations(words, long_operations)
334334
335- return list(words)
335+ return sorted(list(words))
336336
337337 def random_words(
338338 self,

The check that tells the two apart

failpass·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.

Other bugs found in mrmaxguns/wonderwordsmodule