forked from google/pygtrie
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce walk_towards method for walking a path to node with given key
Provide a walk_towards method which generalises prefixes method and allows walking towards particular node and accessing each step of the path. Compared to prefixes method, steps for nodes without assigned values are returned and the method raises KeyError if trying to walk towards non-existent node. Furthermore, at each step value of a node can be manipulated with set and setdefault methods. Fixes: google#20
- Loading branch information
Showing
2 changed files
with
234 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters