mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Issue #16747: Reflow iterable glossary entry to match 3.x change e19ed347523e.
This commit is contained in:
parent
830b4a8570
commit
717e50e43a
1 changed files with 11 additions and 11 deletions
|
@ -378,17 +378,17 @@ Glossary
|
||||||
slowly. See also :term:`interactive`.
|
slowly. See also :term:`interactive`.
|
||||||
|
|
||||||
iterable
|
iterable
|
||||||
An object capable of returning its members one at a
|
An object capable of returning its members one at a time. Examples of
|
||||||
time. Examples of iterables include all sequence types (such as
|
iterables include all sequence types (such as :class:`list`, :class:`str`,
|
||||||
:class:`list`, :class:`str`, and :class:`tuple`) and some non-sequence
|
and :class:`tuple`) and some non-sequence types like :class:`dict`
|
||||||
types like :class:`dict` and :class:`file` and objects of any classes you
|
and :class:`file` and objects of any classes you define
|
||||||
define with an :meth:`__iter__` or :meth:`__getitem__` method. Iterables
|
with an :meth:`__iter__` or :meth:`__getitem__` method. Iterables can be
|
||||||
can be used in a :keyword:`for` loop and in many other places where a
|
used in a :keyword:`for` loop and in many other places where a sequence is
|
||||||
sequence is needed (:func:`zip`, :func:`map`, ...). When an iterable
|
needed (:func:`zip`, :func:`map`, ...). When an iterable object is passed
|
||||||
object is passed as an argument to the built-in function :func:`iter`, it
|
as an argument to the built-in function :func:`iter`, it returns an
|
||||||
returns an iterator for the object. This iterator is good for one pass
|
iterator for the object. This iterator is good for one pass over the set
|
||||||
over the set of values. When using iterables, it is usually not necessary
|
of values. When using iterables, it is usually not necessary to call
|
||||||
to call :func:`iter` or deal with iterator objects yourself. The ``for``
|
:func:`iter` or deal with iterator objects yourself. The ``for``
|
||||||
statement does that automatically for you, creating a temporary unnamed
|
statement does that automatically for you, creating a temporary unnamed
|
||||||
variable to hold the iterator for the duration of the loop. See also
|
variable to hold the iterator for the duration of the loop. See also
|
||||||
:term:`iterator`, :term:`sequence`, and :term:`generator`.
|
:term:`iterator`, :term:`sequence`, and :term:`generator`.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue