cpython: 2afc0997e440 (original) (raw)
Mercurial > cpython
changeset 81248:2afc0997e440 3.2
#16747: fix link to file objects in the glossary. [#16747]
Ezio Melotti ezio.melotti@gmail.com | |
---|---|
date | Wed, 02 Jan 2013 22:29:09 +0200 |
parents | 1f42ecc05d39 |
children | 6e4fc5e2acf8 c4a4863b85b2 |
files | Doc/glossary.rst |
diffstat | 1 files changed, 11 insertions(+), 11 deletions(-)[+] [-] Doc/glossary.rst 22 |
line wrap: on
line diff
--- a/Doc/glossary.rst
+++ b/Doc/glossary.rst
@@ -356,17 +356,17 @@ Glossary
slowly. See also :term:interactive
.
iterable
An object capable of returning its members one at a[](#l1.7)
time. Examples of iterables include all sequence types (such as[](#l1.8)
:class:`list`, :class:`str`, and :class:`tuple`) and some non-sequence[](#l1.9)
types like :class:`dict` and :class:`file` and objects of any classes you[](#l1.10)
define with an :meth:`__iter__` or :meth:`__getitem__` method. Iterables[](#l1.11)
can be used in a :keyword:`for` loop and in many other places where a[](#l1.12)
sequence is needed (:func:`zip`, :func:`map`, ...). When an iterable[](#l1.13)
object is passed as an argument to the built-in function :func:`iter`, it[](#l1.14)
returns an iterator for the object. This iterator is good for one pass[](#l1.15)
over the set of values. When using iterables, it is usually not necessary[](#l1.16)
to call :func:`iter` or deal with iterator objects yourself. The ``for``[](#l1.17)
An object capable of returning its members one at a time. Examples of[](#l1.18)
iterables include all sequence types (such as :class:`list`, :class:`str`,[](#l1.19)
and :class:`tuple`) and some non-sequence types like :class:`dict`,[](#l1.20)
:term:`file objects <file object>`, and objects of any classes you define[](#l1.21)
with an :meth:`__iter__` or :meth:`__getitem__` method. Iterables can be[](#l1.22)
used in a :keyword:`for` loop and in many other places where a sequence is[](#l1.23)
needed (:func:`zip`, :func:`map`, ...). When an iterable object is passed[](#l1.24)
as an argument to the built-in function :func:`iter`, it returns an[](#l1.25)
iterator for the object. This iterator is good for one pass over the set[](#l1.26)
of values. When using iterables, it is usually not necessary to call[](#l1.27)
:func:`iter` or deal with iterator objects yourself. The ``for``[](#l1.28) statement does that automatically for you, creating a temporary unnamed[](#l1.29) variable to hold the iterator for the duration of the loop. See also[](#l1.30) :term:`iterator`, :term:`sequence`, and :term:`generator`.[](#l1.31)