diff options
author | Julien Palard <julien@palard.fr> | 2019-09-11 13:01:18 (GMT) |
---|---|---|
committer | Stéphane Wirtel <stephane@wirtel.be> | 2019-09-11 13:01:18 (GMT) |
commit | e1d455f3a3b82c2e08d5e133bcbab5a181b66cfb (patch) | |
tree | 4f93c77dd1c5289b83415f66453b47503f7aff73 /Doc/library/http.client.rst | |
parent | 37c22206981f52ae35c28b39f7530f8438afbfdb (diff) | |
download | cpython-e1d455f3a3b82c2e08d5e133bcbab5a181b66cfb.zip cpython-e1d455f3a3b82c2e08d5e133bcbab5a181b66cfb.tar.gz cpython-e1d455f3a3b82c2e08d5e133bcbab5a181b66cfb.tar.bz2 |
Doc: Use walrus operator in example. (GH-15934)
Diffstat (limited to 'Doc/library/http.client.rst')
-rw-r--r-- | Doc/library/http.client.rst | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/Doc/library/http.client.rst b/Doc/library/http.client.rst index 48bc35c..db26d56 100644 --- a/Doc/library/http.client.rst +++ b/Doc/library/http.client.rst @@ -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"... ... |