Skip to content

Commit b6bc7d2

Browse files
committed
Rename/remove unused variables
1 parent 0796049 commit b6bc7d2

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

dpath/segments.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def expand(segments):
111111
expand(keys) -> (..., keys[:-2], keys[:-1])
112112
"""
113113
index = 0
114-
for segment in segments:
114+
for _ in segments:
115115
index += 1
116116
yield segments[:index]
117117

@@ -185,13 +185,13 @@ def match(segments, glob):
185185
path_len = len(segments)
186186
glob_len = len(glob)
187187

188-
# Index of the star-star in the glob.
189-
ss = -1
190188
# The star-star normalized glob ('**' has been removed).
191189
ss_glob = glob
192190

193191
if '**' in glob:
192+
# Index of the star-star in the glob.
194193
ss = glob.index('**')
194+
195195
if '**' in glob[ss + 1:]:
196196
raise InvalidGlob("Invalid glob. Only one '**' is permitted per glob: {}"
197197
"".format(glob))
@@ -362,7 +362,6 @@ def foldm(obj, f, acc):
362362
"""
363363
pairs = tuple(walk(obj))
364364
for pair in pairs:
365-
(segments, value) = pair
366365
if f(obj, pair, acc) is False:
367366
break
368367
return acc

dpath/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def get(obj: Dict, glob: str, separator="/", default: Any = _DEFAULT_SENTINEL) -
162162

163163
globlist = _split_path(glob, separator)
164164

165-
def f(obj, pair, results):
165+
def f(_, pair, results):
166166
(path_segments, found) = pair
167167

168168
if segments.match(path_segments, globlist):

0 commit comments

Comments
 (0)