Skip to content

gh-155856: Rephrase doc for "iter" to avoid "collection" - #155857

Open
wjandrea wants to merge 1 commit into
python:mainfrom
wjandrea:patch-4
Open

gh-155856: Rephrase doc for "iter" to avoid "collection"#155857
wjandrea wants to merge 1 commit into
python:mainfrom
wjandrea:patch-4

Conversation

@wjandrea

@wjandrea wjandrea commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Fixes #155856 - The term "collection" is misleading.
Also add link to "sequence".

Comment thread Doc/library/functions.rst Outdated
@wjandrea
wjandrea marked this pull request as draft August 15, 2026 16:16
@read-the-docs-community

read-the-docs-community Bot commented Aug 15, 2026

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #34082506 | 📁 Comparing 41f1d56 against main (948fd7e)

  🔍 Preview build  

1 file changed
± library/functions.html

Fixes python#155856 - The term "collection" is misleading.
Also add link to "sequence".
@wjandrea
wjandrea marked this pull request as ready for review August 15, 2026 17:08

@picnixz picnixz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I overlooked the "term" around the sequence. Ok.

Comment thread Doc/library/functions.rst
the sequence protocol (the :meth:`~object.__getitem__` method with integer arguments
second argument, the single argument must be an object that supports the
:term:`iterable` protocol (the :meth:`~object.__iter__` method) or the
:term:`sequence` protocol (the :meth:`~object.__getitem__` method with integer arguments

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linking to the sequence glossary entry isn't quite correct here, it has stricter requirements (i.e., a __len__ method) than iter()'s requirements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting merge docs Documentation in the Doc dir skip news

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

iter() doesn't require a "collection"

3 participants