One function
PrefixSet in mina86/pygtrie
The author described this change as “Fix PrefixSet.copy method”. It counts as a record because the check below fails on the code as it stood at 905f8c7da and passes on 344a414dd, with nothing else changed between the two runs.
Projectmina86/pygtrie
Fix saved2018-08-10
Sharing licenceApache-2.0 · LICENSE
Change size+1 −1
What the code was meant to do, written into the code itself as a docstring
A set of prefixes. :class:`pygtrie.PrefixSet` works similar to a normal set except it is said to contain a key if the key or it's prefix is stored in the set. For instance, if "foo" is added to the set, the set contains "foo" as well as "foobar". The set supports addition of elements but does *not* support removal of elements. This is because there's no obvious consistent and intuitive behaviour for element deletion.
The change
| 27 | 27 | ||
| 28 | 28 | def copy(self): | |
| 29 | 29 | """Returns a copy of the prefix set.""" | |
| 30 | - | return self.__class__(self._trie) | |
| 30 | + | return self.__class__(self._trie, factory=self._trie.__class__) | |
| 31 | 31 | ||
| 32 | 32 | def clear(self): | |
| 33 | 33 | """Removes all keys from the set.""" |
The check that tells the two apart
fail→pass·test.py::CharTrieTestCase::test_prefix_set
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 it905f8c7da2bfe66e3fc32ece95ba84c5b8d3817e
Broken version dated2018-08-07
Modulepygtrie
Units changedPrefixSet
Fingerprinta601732584b24c9a
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
- 2020-02-26_NoChildren
- 2019-07-17PrefixSet
- 2019-05-27Fix StringTrie.copy ignoring separator and improve PrefixSet.copy