One function
_NoChildren in mina86/pygtrie
The author described this change as “Fix iteration when sorting is enabled”. It counts as a record because the check below fails on the code as it stood at 2b3ed5018 and passes on 6168938d6, with nothing else changed between the two runs.
Projectmina86/pygtrie
Fix saved2020-02-26
Sharing licenceApache-2.0 · LICENSE
Change size+1 −1
What the code was meant to do, written into the code itself as a docstring
Collection representing lack of any children. Also acts as an empty iterable and an empty iterator. This isn’t the cleanest designs but it makes various things more concise and avoids object allocations in a few places. Don’t create objects of this type directly; instead use _EMPTY singleton.
The change
| 16 | 16 | return 0 | |
| 17 | 17 | def __iter__(self): | |
| 18 | 18 | return self | |
| 19 | - | iteritems = __iter__ | |
| 19 | + | iteritems = sorted_items = __iter__ | |
| 20 | 20 | def __next__(self): | |
| 21 | 21 | raise StopIteration() | |
| 22 | 22 | next = __next__ |
The check that tells the two apart
fail→pass·test.py::TraverseTest::test_traverse_Sorted
Check file test.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 it2b3ed50183bc30250095cfc5a8fb030c71190f58
Broken version dated2020-01-22
Modulepygtrie
Units changed_NoChildren
Fingerprinteb070d4ce78c3cd0
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 mina86/pygtrie
- 2019-07-17PrefixSet
- 2019-05-27Fix StringTrie.copy ignoring separator and improve PrefixSet.copy
- 2018-08-10PrefixSet