1
0
Fork 0

Adding upstream version 11.7.1.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-13 15:51:35 +01:00
parent b4e0e3422e
commit 82a8846a46
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
144 changed files with 44104 additions and 39367 deletions

View file

@ -3,7 +3,7 @@ import typing as t
key = t.Sequence[t.Hashable]
def new_trie(keywords: t.Iterable[key]) -> t.Dict:
def new_trie(keywords: t.Iterable[key], trie: t.Optional[t.Dict] = None) -> t.Dict:
"""
Creates a new trie out of a collection of keywords.
@ -16,11 +16,12 @@ def new_trie(keywords: t.Iterable[key]) -> t.Dict:
Args:
keywords: the keywords to create the trie from.
trie: a trie to mutate instead of creating a new one
Returns:
The trie corresponding to `keywords`.
"""
trie: t.Dict = {}
trie = {} if trie is None else trie
for key in keywords:
current = trie