Whole file
jd/tenacity
The author described this change as “Fix ordinal suffix generation for numbers ending in 11, 12, 13 (#556)”. It counts as a record because the check below fails on the code as it stood at d4e868d6b and passes on 0bdf1d9e5, with nothing else changed between the two runs.
Projectjd/tenacity
Fix saved2026-02-17
Sharing licenceApache-2.0 · LICENSE
Change size+4 −0
What the code was meant to do, written into the code itself as a save note
Fix ordinal suffix generation for numbers ending in 11, 12, 13 (#556)
The change
| 39 | 39 | ||
| 40 | 40 | def find_ordinal(pos_num: int) -> str: | |
| 41 | 41 | # See: https://en.wikipedia.org/wiki/English_numerals#Ordinal_numbers | |
| 42 | + | ||
| 43 | + | if 11 <= (pos_num % 100) <= 13: | |
| 44 | + | return "th" | |
| 45 | + | ||
| 42 | 46 | if pos_num == 0: | |
| 43 | 47 | return "th" | |
| 44 | 48 | elif pos_num == 1: |
The check that tells the two apart
fail→pass·tests/test_utils.py::test_find_ordinal
Check file tests/test_utils.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 itd4e868d6b8368c00b5a1fad54de36c2c8c3a0fb3
Broken version dated2026-02-07
Moduletenacity._utils
Units changedfind_ordinal
Fingerprint88042024eadfa374
Checked2026-08-18 by goldset/0.1
Every field above is generated by our program. None of it is written by hand.