mirror of
https://github.com/python/cpython.git
synced 2025-10-17 20:28:43 +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
|
@ -333,10 +333,7 @@ def quote(s):
|
|||
|
||||
|
||||
def _print_tokens(lexer):
|
||||
while 1:
|
||||
tt = lexer.get_token()
|
||||
if not tt:
|
||||
break
|
||||
while tt := lexer.get_token():
|
||||
print("Token: " + repr(tt))
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue