Skip to content

Commit 41f1d56

Browse files
committed
Rephrase doc for "iter" to avoid "collection"
Fixes #155856 - The term "collection" is misleading. Also add link to "sequence".
1 parent 948fd7e commit 41f1d56

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

Doc/library/functions.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,10 +1147,9 @@ are always available. They are listed here in alphabetical order.
11471147

11481148
Return an :term:`iterator` object. The first argument is interpreted very
11491149
differently depending on the presence of the second argument. Without a
1150-
second argument, the single argument must be a collection object which supports the
1151-
:term:`iterable` protocol (the :meth:`~object.__iter__` method),
1152-
or it must support
1153-
the sequence protocol (the :meth:`~object.__getitem__` method with integer arguments
1150+
second argument, the single argument must be an object that supports the
1151+
:term:`iterable` protocol (the :meth:`~object.__iter__` method) or the
1152+
:term:`sequence` protocol (the :meth:`~object.__getitem__` method with integer arguments
11541153
starting at ``0``). If it does not support either of those protocols,
11551154
:exc:`TypeError` is raised. If the second argument, *sentinel*, is given,
11561155
then the first argument must be a callable object. The iterator created in this case

0 commit comments

Comments
 (0)