summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2012-10-12 16:04:32 (GMT)
committerBenjamin Peterson <benjamin@python.org>2012-10-12 16:04:32 (GMT)
commit143d034ecd110f8543eba4ad76dfb6085cdaeb3d (patch)
tree9ddcfc6fe0d0cf8ce8558f88969bf1f9e98c1d25 /Doc/library
parentc3de6d63cd20cd26a288999d454124cb72eb57fe (diff)
parent7a9953edfbbd51dbda60ab31c0e5db5eea968b53 (diff)
downloadcpython-143d034ecd110f8543eba4ad76dfb6085cdaeb3d.zip
cpython-143d034ecd110f8543eba4ad76dfb6085cdaeb3d.tar.gz
cpython-143d034ecd110f8543eba4ad76dfb6085cdaeb3d.tar.bz2
merge 3.2
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/2to3.rst2
-rw-r--r--Doc/library/concurrent.futures.rst22
-rw-r--r--Doc/library/dis.rst8
-rw-r--r--Doc/library/functions.rst21
-rw-r--r--Doc/library/stdtypes.rst9
5 files changed, 33 insertions, 29 deletions
diff --git a/Doc/library/2to3.rst b/Doc/library/2to3.rst
index a13fb65..d07aaa1 100644
--- a/Doc/library/2to3.rst
+++ b/Doc/library/2to3.rst
@@ -23,7 +23,7 @@ Using 2to3
also located in the :file:`Tools/scripts` directory of the Python root.
2to3's basic arguments are a list of files or directories to transform. The
-directories are to recursively traversed for Python sources.
+directories are recursively traversed for Python sources.
Here is a sample Python 2.x source file, :file:`example.py`::
diff --git a/Doc/library/concurrent.futures.rst b/Doc/library/concurrent.futures.rst
index a88f10c..8908542 100644
--- a/Doc/library/concurrent.futures.rst
+++ b/Doc/library/concurrent.futures.rst
@@ -42,12 +42,13 @@ Executor Objects
Equivalent to ``map(func, *iterables)`` except *func* is executed
asynchronously and several calls to *func* may be made concurrently. The
- returned iterator raises a :exc:`TimeoutError` if :meth:`__next__()` is
- called and the result isn't available after *timeout* seconds from the
- original call to :meth:`Executor.map`. *timeout* can be an int or a
- float. If *timeout* is not specified or ``None``, there is no limit to
- the wait time. If a call raises an exception, then that exception will
- be raised when its value is retrieved from the iterator.
+ returned iterator raises a :exc:`TimeoutError` if
+ :meth:`~iterator.__next__` is called and the result isn't available
+ after *timeout* seconds from the original call to :meth:`Executor.map`.
+ *timeout* can be an int or a float. If *timeout* is not specified or
+ ``None``, there is no limit to the wait time. If a call raises an
+ exception, then that exception will be raised when its value is
+ retrieved from the iterator.
.. method:: shutdown(wait=True)
@@ -364,10 +365,11 @@ Module Functions
different :class:`Executor` instances) given by *fs* that yields futures as
they complete (finished or were cancelled). Any futures that completed
before :func:`as_completed` is called will be yielded first. The returned
- iterator raises a :exc:`TimeoutError` if :meth:`__next__` is called and the
- result isn't available after *timeout* seconds from the original call to
- :func:`as_completed`. *timeout* can be an int or float. If *timeout* is not
- specified or ``None``, there is no limit to the wait time.
+ iterator raises a :exc:`TimeoutError` if :meth:`~iterator.__next__` is
+ called and the result isn't available after *timeout* seconds from the
+ original call to :func:`as_completed`. *timeout* can be an int or float.
+ If *timeout* is not specified or ``None``, there is no limit to the wait
+ time.
.. seealso::
diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst
index 6d08a0c..854c521 100644
--- a/Doc/library/dis.rst
+++ b/Doc/library/dis.rst
@@ -660,10 +660,10 @@ the more significant byte last.
.. opcode:: FOR_ITER (delta)
- ``TOS`` is an :term:`iterator`. Call its :meth:`__next__` method. If this
- yields a new value, push it on the stack (leaving the iterator below it). If
- the iterator indicates it is exhausted ``TOS`` is popped, and the byte code
- counter is incremented by *delta*.
+ ``TOS`` is an :term:`iterator`. Call its :meth:`~iterator.__next__` method.
+ If this yields a new value, push it on the stack (leaving the iterator below
+ it). If the iterator indicates it is exhausted ``TOS`` is popped, and the
+ byte code counter is incremented by *delta*.
.. opcode:: LOAD_GLOBAL (namei)
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst
index e969194..173baf4 100644
--- a/Doc/library/functions.rst
+++ b/Doc/library/functions.rst
@@ -348,10 +348,10 @@ are always available. They are listed here in alphabetical order.
.. function:: enumerate(iterable, start=0)
Return an enumerate object. *iterable* must be a sequence, an
- :term:`iterator`, or some other object which supports iteration. The
- :meth:`__next__` method of the iterator returned by :func:`enumerate` returns a
- tuple containing a count (from *start* which defaults to 0) and the
- values obtained from iterating over *iterable*.
+ :term:`iterator`, or some other object which supports iteration.
+ The :meth:`~iterator.__next__` method of the iterator returned by
+ :func:`enumerate` returns a tuple containing a count (from *start* which
+ defaults to 0) and the values obtained from iterating over *iterable*.
>>> seasons = ['Spring', 'Summer', 'Fall', 'Winter']
>>> list(enumerate(seasons))
@@ -683,9 +683,10 @@ are always available. They are listed here in alphabetical order.
starting at ``0``). If it does not support either of those protocols,
:exc:`TypeError` is raised. If the second argument, *sentinel*, is given,
then *object* must be a callable object. The iterator created in this case
- will call *object* with no arguments for each call to its :meth:`__next__`
- method; if the value returned is equal to *sentinel*, :exc:`StopIteration`
- will be raised, otherwise the value will be returned.
+ will call *object* with no arguments for each call to its
+ :meth:`~iterator.__next__` method; if the value returned is equal to
+ *sentinel*, :exc:`StopIteration` will be raised, otherwise the value will
+ be returned.
One useful application of the second form of :func:`iter` is to read lines of
a file until a certain line is reached. The following example reads a file
@@ -779,9 +780,9 @@ are always available. They are listed here in alphabetical order.
.. function:: next(iterator[, default])
- Retrieve the next item from the *iterator* by calling its :meth:`__next__`
- method. If *default* is given, it is returned if the iterator is exhausted,
- otherwise :exc:`StopIteration` is raised.
+ Retrieve the next item from the *iterator* by calling its
+ :meth:`~iterator.__next__` method. If *default* is given, it is returned
+ if the iterator is exhausted, otherwise :exc:`StopIteration` is raised.
.. function:: object()
diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst
index ed5b3ae..557c433 100644
--- a/Doc/library/stdtypes.rst
+++ b/Doc/library/stdtypes.rst
@@ -779,9 +779,9 @@ specific sequence types, dictionaries, and other more specialized forms. The
specific types are not important beyond their implementation of the iterator
protocol.
-Once an iterator's :meth:`__next__` method raises :exc:`StopIteration`, it must
-continue to do so on subsequent calls. Implementations that do not obey this
-property are deemed broken.
+Once an iterator's :meth:`~iterator.__next__` method raises
+:exc:`StopIteration`, it must continue to do so on subsequent calls.
+Implementations that do not obey this property are deemed broken.
.. _generator-types:
@@ -792,7 +792,8 @@ Generator Types
Python's :term:`generator`\s provide a convenient way to implement the iterator
protocol. If a container object's :meth:`__iter__` method is implemented as a
generator, it will automatically return an iterator object (technically, a
-generator object) supplying the :meth:`__iter__` and :meth:`__next__` methods.
+generator object) supplying the :meth:`__iter__` and :meth:`~generator.__next__`
+methods.
More information about generators can be found in :ref:`the documentation for
the yield expression <yieldexpr>`.