[Python-checkins] (no subject)

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




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

https://github.com/python/cpython/commit/e1d455f3a3b82c2e08d5e133bcbab5a181b6=
6cfb
commit: e1d455f3a3b82c2e08d5e133bcbab5a181b66cfb
branch: master
author: Julien Palard <julien at palard.fr>
committer: St=C3=A9phane Wirtel <stephane at wirtel.be>
date: 2019-09-11T15:01:18+02:00
summary:

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

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