New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
range() description: rewording suggested #36242
Comments
The help now has: It might say: range([start= 0,] stop[, step= 1])
This function creates a list containing an arithmetic progression.
The arguments must be integers. If only one argument is passed it
is the 'stop' value, if two values are passed then the first is the
'start' value and the second the 'stop' value.
The function returns a list of integers [start, start + step, start
+ 2 * step, ...]. The 'step' must not be zero; if 'step' is positive,
the last element is the largest; if 'step' is negative, the last
element is the smallest. Using Python 2.2 The main intent is to clarify the usage of the optional arguments. |
Logged In: YES IMO, the current version is clearer than the re-write. A side note, the docstring for range() is shorter and range(...)
range([start,] stop[, step]) -> list of integers
Return a list containing an arithmetic progression of
integers. range(i, j) returns [i, i+1, i+2, ..., j-1];
start (!) defaults to 0. When step is given, it specifies
the increment (or decrement). For example, range(4)
returns [0, 1, 2, 3]. The end point is omitted! These are
exactly the valid indices for a list of 4 elements. |
Logged In: YES I agree with Raymond. Closing the bug as rejected. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: