-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
Signature of slice is documented incorrectly #107755
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
Labels
docs
Documentation in the Doc dir
Comments
wimglenn
added a commit
to wimglenn/cpython
that referenced
this issue
Aug 8, 2023
wimglenn
added a commit
to wimglenn/cpython
that referenced
this issue
Aug 15, 2023
encukou
pushed a commit
that referenced
this issue
Sep 5, 2023
Document the correct default value of slice step.
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Sep 5, 2023
…thonGH-107756) Document the correct default value of slice step. (cherry picked from commit 9bf350b) Co-authored-by: wim glenn <[email protected]>
This was referenced Sep 5, 2023
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Sep 5, 2023
…thonGH-107756) Document the correct default value of slice step. (cherry picked from commit 9bf350b) Co-authored-by: wim glenn <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Documentation
https://docs.python.org/3/library/functions.html#slice currently shows:
This was changed from
slice(start, stop[, step])
in #96579. That default forstep
is incorrect. It's correct in a range, but in a slice it actually defaults toNone
:Most code handle
step=1
andstep=None
the same way when receiving a slice, but user defined types implementing__getitem__
/__setitem__
/__delitem__
aren't obliged to, and the correct default should be documented.Linked PRs
The text was updated successfully, but these errors were encountered: