mirror of
https://github.com/python/cpython.git
synced 2025-07-10 04:45:36 +00:00
bpo-45975: Simplify some while-loops with walrus operator (GH-29347)
This commit is contained in:
parent
25bc115df9
commit
024ac542d7
28 changed files with 41 additions and 153 deletions
|
@ -686,9 +686,7 @@ class HTMLDoc(Doc):
|
|||
r'RFC[- ]?(\d+)|'
|
||||
r'PEP[- ]?(\d+)|'
|
||||
r'(self\.)?(\w+))')
|
||||
while True:
|
||||
match = pattern.search(text, here)
|
||||
if not match: break
|
||||
while match := pattern.search(text, here):
|
||||
start, end = match.span()
|
||||
results.append(escape(text[here:start]))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue