summaryrefslogtreecommitdiff
path: root/collect/trie.py
diff options
context:
space:
mode:
Diffstat (limited to 'collect/trie.py')
-rw-r--r--collect/trie.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/collect/trie.py b/collect/trie.py
index 3e4c917..70d57b1 100644
--- a/collect/trie.py
+++ b/collect/trie.py
@@ -11,6 +11,7 @@ class Trie(object):
for examples.
"""
+
def __init__(self):
self.root = {}
self.end = "~END~"
@@ -241,7 +242,14 @@ class Trie(object):
return None
return [x for x in node if x != self.end]
- def repr_fancy(self, padding: str, pointer: str, parent: str, node: Any, has_sibling: bool):
+ def repr_fancy(
+ self,
+ padding: str,
+ pointer: str,
+ parent: str,
+ node: Any,
+ has_sibling: bool,
+ ):
if node is None:
return
if node is not self.root:
@@ -328,4 +336,5 @@ class Trie(object):
if __name__ == '__main__':
import doctest
+
doctest.testmod()