From c97ee1d3d8fdcbe6ca560767b532198027457d80 Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Wirtel?= Date: Wed, 11 Sep 2019 15:17:48 +0200 Subject: [PATCH] [3.8] Doc: Use walrus operator in example. (GH-15934) (GH-15936) (cherry picked from commit e1d455f3a3b82c2e08d5e133bcbab5a181b66cfb) Co-authored-by: Julien Palard --- Doc/library/http.client.rst | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Doc/library/http.client.rst b/Doc/library/http.client.rst index 48bc35ca76cc..db26d56af30f 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'\n