mirror of
https://github.com/python/cpython.git
synced 2025-09-27 10:50:04 +00:00
Doc: Use walrus operator in example. (GH-15934)
This commit is contained in:
parent
37c2220698
commit
e1d455f3a3
1 changed files with 1 additions and 4 deletions
|
@ -516,10 +516,7 @@ Here is an example session that uses the ``GET`` method::
|
|||
>>> # The following example demonstrates reading data in chunks.
|
||||
>>> conn.request("GET", "/")
|
||||
>>> r1 = conn.getresponse()
|
||||
>>> while True:
|
||||
... chunk = r1.read(200) # 200 bytes
|
||||
... if not chunk:
|
||||
... break
|
||||
>>> while chunk := r1.read(200):
|
||||
... print(repr(chunk))
|
||||
b'<!doctype html>\n<!--[if"...
|
||||
...
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue