-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Addition in list indexing related to negative step #782
Comments
Thanks for reporting; it's about time we give this material another review. |
How does one contribute to the material? Is it enough to report any such issue or would it be better to make a pull request? |
FWIW I think the case you describe is sufficiently illustrated in the third example under the Lists heading. However, please feel free to open PRs with suggestions! |
@rossbar Thanks for letting me know that PRs are welcome. If you were pointing to this |
In https://lectures.scientific-python.org/intro/language/basic_types.html#lists it is mentioned that all slicing parameters are optional. And a few examples are shown to demonstrate what values are implicitly set when you skip these.
However the examples miss a case with negative step value. With a negative step value, the start is implicitly set to -1. Which differs from positive step value cases, where if the start is skipped, the start index is implicitly set to 0.
Although negative step is demonstrated later on, it is just with regarding to reversing a list. This aspect is not made clear there.
Maybe this can also be a warning or something.?
The text was updated successfully, but these errors were encountered: