Skip to content

gh-145591: Move slicing note to subscription methods section#145606

Merged
encukou merged 2 commits intopython:mainfrom
Towaiji:gh-145591-slicing-note-move
Mar 10, 2026
Merged

gh-145591: Move slicing note to subscription methods section#145606
encukou merged 2 commits intopython:mainfrom
Towaiji:gh-145591-slicing-note-move

Conversation

@Towaiji
Copy link
Contributor

@Towaiji Towaiji commented Mar 6, 2026

This PR moves the slicing note out of the object.__length_hint__ section and places it with the subscription protocol under object.__getitem__.

That keeps the slicing translation example (a[1:2] = b -> a[slice(1, 2, None)] = b) next to the relevant special methods (__getitem__, __setitem__, __delitem__).

Issue: #145591


📚 Documentation preview 📚: https://cpython-previews--145606.org.readthedocs.build/

@python-cla-bot
Copy link

python-cla-bot bot commented Mar 6, 2026

All commit authors signed the Contributor License Agreement.

CLA signed

@bedevere-app bedevere-app bot added docs Documentation in the Doc dir skip news labels Mar 6, 2026
@github-project-automation github-project-automation bot moved this to Todo in Docs PRs Mar 6, 2026
@Towaiji
Copy link
Contributor Author

Towaiji commented Mar 9, 2026

Gentle follow-up in case this PR slipped through the queue. Please let me know if the placement or wording should be adjusted. Thanks!

@encukou
Copy link
Member

encukou commented Mar 10, 2026

See the issue.

@Towaiji
Copy link
Contributor Author

Towaiji commented Mar 10, 2026

Thanks for the clarification. I pushed a follow-up commit that explicitly names the three methods (__getitem__, __setitem__, and __delitem__) in the note and keeps it under __getitem__.

@encukou
Copy link
Member

encukou commented Mar 10, 2026

Thank you!

@encukou encukou merged commit 2114da9 into python:main Mar 10, 2026
28 checks passed
@encukou encukou added the needs backport to 3.13 bugs and security fixes label Mar 10, 2026
@encukou encukou added the needs backport to 3.14 bugs and security fixes label Mar 10, 2026
@github-project-automation github-project-automation bot moved this from Todo to Done in Docs PRs Mar 10, 2026
@miss-islington-app
Copy link

Thanks @Towaiji for the PR, and @encukou for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

@miss-islington-app
Copy link

Thanks @Towaiji for the PR, and @encukou for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 10, 2026
(cherry picked from commit 2114da9)

Co-authored-by: Ali Towaiji <145403626+Towaiji@users.noreply.github.com>
@miss-islington-app
Copy link

Sorry, @Towaiji and @encukou, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 2114da976c3d85a85283d1a9437bdf8604626be8 3.13

@bedevere-app
Copy link

bedevere-app bot commented Mar 10, 2026

GH-145760 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label Mar 10, 2026
@encukou encukou removed the needs backport to 3.13 bugs and security fixes label Mar 10, 2026
encukou pushed a commit that referenced this pull request Mar 11, 2026
…5760)

(cherry picked from commit 2114da9)

Co-authored-by: Ali Towaiji <145403626+Towaiji@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip news

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants