8000 rename variable `indices` to `star_indices` · python/cpython@0226437 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0226437

Browse files
committed
rename variable indices to star_indices
1 parent 1d52949 commit 0226437

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Lib/fnmatch.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,15 @@ def translate(pat):
8686
def _translate(pat, star, question_mark):
8787
res = []
8888
add = res.append
89-
indices = []
89+
star_indices = []
9090

9191
i, n = 0, len(pat)
9292
while i < n:
9393
c = pat[i]
9494
i = i+1
9595
if c == '*':
9696
# store the position of the wildcard
97-
indices.append(len(res))
97+
star_indices.append(len(res))
9898
add(star)
9999
# compress consecutive `*` into one
100100
while i < n and pat[i] == '*':
@@ -160,18 +160,18 @@ def _translate(pat, star, question_mark):
160160
else:
161161
add(_re_escape(c))
162162
assert i == n
163-
return res, indices
163+
return res, star_indices
164164

165165

166-
def _join_translated_parts(parts, indices):
167-
if not indices:
166+
def _join_translated_parts(parts, star_indices):
167+
if not star_indices:
168168
return fr'(?s:{"".join(parts)})\Z'
169-
iter_indices = iter(indices)
170-
j = next(iter_indices)
169+
iter_star_indices = iter(star_indices)
170+
j = next(iter_star_indices)
171171
buffer = parts[:j] # fixed pieces at the start
172172
append, extend = buffer.append, buffer.extend
173173
i = j + 1
174-
for j in iter_indices:
174+
for j in iter_star_indices:
175175
# Now deal with STAR fixed STAR fixed ...
176176
# For an interior `STAR fixed` pairing, we want to do a minimal
177177
# .*? match followed by `fixed`, with no possibility of backtracking.

0 commit comments

Comments
 (0)
0