diff options
author | 4l4k4z4m <alakazamjoined@gmail.com> | 2023-01-03 08:16:51 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-03 08:16:51 (GMT) |
commit | 8b1f1251215651c4ef988622345c5cb134e54d69 (patch) | |
tree | ac679f1ac72a218ff941b40ffb683295bf71e7c9 | |
parent | 73097d91a64620ae7f620705864b84234d85cc82 (diff) | |
download | cpython-8b1f1251215651c4ef988622345c5cb134e54d69.zip cpython-8b1f1251215651c4ef988622345c5cb134e54d69.tar.gz cpython-8b1f1251215651c4ef988622345c5cb134e54d69.tar.bz2 |
gh-81611: Improve `range` paragraph in 8.3 of language reference (#98353)
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
-rw-r--r-- | Doc/reference/compound_stmts.rst | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Doc/reference/compound_stmts.rst b/Doc/reference/compound_stmts.rst index fe9dda9..d5cb289 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. .. versionchanged:: 3.11 Starred elements are now allowed in the expression list. |