mirror of
https://github.com/python/cpython.git
synced 2025-08-24 02:35:59 +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
|
@ -1956,10 +1956,7 @@ class _ProxyFile:
|
|||
|
||||
def __iter__(self):
|
||||
"""Iterate over lines."""
|
||||
while True:
|
||||
line = self.readline()
|
||||
if not line:
|
||||
return
|
||||
while line := self.readline():
|
||||
yield line
|
||||
|
||||
def tell(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue