44
55from dpath import options
66from dpath .exceptions import InvalidGlob , InvalidKeyName , PathNotFound
7- from dpath .types import PathSegment , Creator , Hints , Glob , Path , CyclicInt
7+ from dpath .types import PathSegment , Creator , Hints , Glob , Path , SymmetricInt
88
99
1010def make_walkable (node ) -> Iterator [Tuple [PathSegment , Any ]]:
@@ -22,8 +22,8 @@ def make_walkable(node) -> Iterator[Tuple[PathSegment, Any]]:
2222 except AttributeError :
2323 try :
2424 indices = range (len (node ))
25- # Make all list indices cyclic so negative (wraparound) indexes are supported
26- indices = map (lambda i : CyclicInt (i , len (node )), indices )
25+ # Convert all list indices to object so negative indexes are supported.
26+ indices = map (lambda i : SymmetricInt (i , len (node )), indices )
2727 return zip (indices , node )
2828 except TypeError :
2929 # This can happen in cases where the node isn't leaf(node) == True,
@@ -217,7 +217,6 @@ def match(segments: Path, glob: Glob):
217217 # If we were successful in matching up the lengths, then we can
218218 # compare them using fnmatch.
219219 if path_len == len (ss_glob ):
220- # TODO: Delete if not needed (previous code) - i = zip(map(int_str, segments), map(int_str, ss_glob))
221220 i = zip (segments , ss_glob )
222221 for s , g in i :
223222 # Match the stars we added to the glob to the type of the
0 commit comments