Commit e1d455f3 authored by Julien Palard's avatar Julien Palard Committed by Stéphane Wirtel

Doc: Use walrus operator in example. (GH-15934)

parent 37c22206
...@@ -516,10 +516,7 @@ Here is an example session that uses the ``GET`` method:: ...@@ -516,10 +516,7 @@ Here is an example session that uses the ``GET`` method::
>>> # The following example demonstrates reading data in chunks. >>> # The following example demonstrates reading data in chunks.
>>> conn.request("GET", "/") >>> conn.request("GET", "/")
>>> r1 = conn.getresponse() >>> r1 = conn.getresponse()
>>> while True: >>> while chunk := r1.read(200):
... chunk = r1.read(200) # 200 bytes
... if not chunk:
... break
... print(repr(chunk)) ... print(repr(chunk))
b'<!doctype html>\n<!--[if"... b'<!doctype html>\n<!--[if"...
... ...
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment