[Python-checkins] [3.10] gh-81611: Improve `range` paragraph in 8.3 of language reference (GH-98353) (#100705)

terryjreedy webhook-mailer at python.org
Wed Jan 4 16:00:33 EST 2023


https://github.com/python/cpython/commit/fee4059d213401011457531933e64790b181f33c
commit: fee4059d213401011457531933e64790b181f33c
branch: 3.10
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: terryjreedy <tjreedy at udel.edu>
date: 2023-01-04T16:00:27-05:00
summary:

[3.10] gh-81611: Improve `range` paragraph in 8.3 of language reference (GH-98353) (#100705)

gh-81611: Improve `range` paragraph in 8.3 of language reference (GH-98353)
(cherry picked from commit 8b1f1251215651c4ef988622345c5cb134e54d69)

Co-authored-by: 4l4k4z4m <alakazamjoined at gmail.com>
Co-authored-by: Kumar Aditya <59607654+kumaraditya303 at users.noreply.github.com>
Co-authored-by: Terry Jan Reedy <tjreedy at udel.edu>

files:
M Doc/reference/compound_stmts.rst

diff --git a/Doc/reference/compound_stmts.rst b/Doc/reference/compound_stmts.rst
index 58b88c4d37f1..20c85a9c8677 100644
--- a/Doc/reference/compound_stmts.rst
+++ b/Doc/reference/compound_stmts.rst
@@ -192,9 +192,8 @@ those made in the suite of the for-loop::
 
 Names in the target list are not deleted when the loop is finished, but if the
 sequence is empty, they will not have been assigned to at all by the loop.  Hint:
-the built-in function :func:`range` returns an iterator of integers suitable to
-emulate the effect of Pascal's ``for i := a to b do``; e.g., ``list(range(3))``
-returns the list ``[0, 1, 2]``.
+the built-in type :func:`range` represents immutable arithmetic sequences of integers.
+For instance, iterating ``range(3)`` successively yields 0, 1, and then 2.
 
 
 .. _try:



More information about the Python-checkins mailing list