[Python-checkins] (no subject)

Stéphane Wirtel webhook-mailer at python.org
Wed Sep 11 09:17:52 EDT 2019




To: python-checkins at python.org
Subject: [3.8] Doc: Use walrus operator in example. (GH-15934) (GH-15936)
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0

https://github.com/python/cpython/commit/c97ee1d3d8fdcbe6ca560767b53219802745=
7d80
commit: c97ee1d3d8fdcbe6ca560767b532198027457d80
branch: 3.8
author: St=C3=A9phane Wirtel <stephane at wirtel.be>
committer: GitHub <noreply at github.com>
date: 2019-09-11T15:17:48+02:00
summary:

[3.8] Doc: Use walrus operator in example. (GH-15934) (GH-15936)

(cherry picked from commit e1d455f3a3b82c2e08d5e133bcbab5a181b66cfb)

Co-authored-by: Julien Palard <julien at palard.fr>

files:
M Doc/library/http.client.rst

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 =3D conn.getresponse()
-   >>> while True:
-   ...     chunk =3D r1.read(200)  # 200 bytes
-   ...     if not chunk:
-   ...          break
+   >>> while chunk :=3D r1.read(200):
    ...     print(repr(chunk))
    b'<!doctype html>\n<!--[if"...
    ...



More information about the Python-checkins mailing list