projects
/
python_utils.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Stop trying to cache mac addresses from house and cabin in the same
[python_utils.git]
/
collect
/
trie.py
diff --git
a/collect/trie.py
b/collect/trie.py
index 3e4c9172fbbf3b01202f6c9ccc5b2d4ff607fcc1..70d57b1338ca8e19e4bde07e33e440a846bdc79e 100644
(file)
--- a/
collect/trie.py
+++ b/
collect/trie.py
@@
-11,6
+11,7
@@
class Trie(object):
for examples.
"""
for examples.
"""
+
def __init__(self):
self.root = {}
self.end = "~END~"
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]
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:
if node is None:
return
if node is not self.root:
@@
-328,4
+336,5
@@
class Trie(object):
if __name__ == '__main__':
import doctest
if __name__ == '__main__':
import doctest
+
doctest.testmod()
doctest.testmod()