Commit df78fb8
Cache _natural_simpler_chars and extend candidates with all chars
Per review:
- ``.update()`` the candidate set with every character of the case-mapped
and decomposed forms instead of only single-character results. This
lets e.g. ``ß`` shrink to ``s`` via ``casefold() == "ss"``, and adds
``i`` (alongside ``f``) as a candidate when shrinking the ``fi`` ligature.
- Wrap the helper in ``lru_cache(maxsize=4096)`` since it gets called in
tight loops from the shrink pass's chooser predicates.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 08f6bbb commit df78fb8
2 files changed
Lines changed: 13 additions & 4 deletions
File tree
- hypothesis-python
- src/hypothesis/internal/conjecture
- tests/conjecture
Lines changed: 9 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
90 | 91 | | |
91 | 92 | | |
92 | 93 | | |
| 94 | + | |
93 | 95 | | |
94 | 96 | | |
95 | 97 | | |
96 | | - | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
97 | 101 | | |
98 | 102 | | |
99 | 103 | | |
100 | 104 | | |
101 | 105 | | |
102 | 106 | | |
103 | | - | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
104 | 110 | | |
105 | | - | |
106 | | - | |
| 111 | + | |
107 | 112 | | |
108 | 113 | | |
109 | 114 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
804 | 804 | | |
805 | 805 | | |
806 | 806 | | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
807 | 811 | | |
808 | 812 | | |
809 | 813 | | |
| |||
0 commit comments