summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorAlexandre Vassalotti <alexandre@peadrop.com>2008-05-16 02:54:33 (GMT)
committerAlexandre Vassalotti <alexandre@peadrop.com>2008-05-16 02:54:33 (GMT)
commiteca20b611433fac88057da092efc0b6d6d2a7fb3 (patch)
treeb7c6ce421f22a464f28152ea7620e09cde051f1f /Doc
parent18bf893935343a918f9d00b3b934d858607bdc40 (diff)
downloadcpython-eca20b611433fac88057da092efc0b6d6d2a7fb3.zip
cpython-eca20b611433fac88057da092efc0b6d6d2a7fb3.tar.gz
cpython-eca20b611433fac88057da092efc0b6d6d2a7fb3.tar.bz2
Merged revisions 63119-63128,63130-63131,63133,63135-63144,63146-63148,63151-63152,63155-63165,63167-63176,63181-63186,63188-63189 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r63119 | benjamin.peterson | 2008-05-11 20:41:23 -0400 (Sun, 11 May 2008) | 2 lines #2196 hasattr now allows SystemExit and KeyboardInterrupt to propagate ........ r63122 | benjamin.peterson | 2008-05-11 20:46:49 -0400 (Sun, 11 May 2008) | 2 lines make message slightly more informative, so there's no chance of misunderstanding it ........ r63158 | ronald.oussoren | 2008-05-12 07:24:33 -0400 (Mon, 12 May 2008) | 5 lines Remove references to platform 'mac' The 'mac' platform (that is, os.name == 'mac') was used for the MacOS 9 port, which is no longer supported (as of Python 2.4 IIRC). ........ r63159 | ronald.oussoren | 2008-05-12 07:31:05 -0400 (Mon, 12 May 2008) | 8 lines MacOSX: remove dependency on Carbon package for urllib This patch removes the dependency on the Carbon package from urllib. The mac-specific code for getting proxy configuration is now writting in Python using ctypes and uses the SystemConfiguration framework instead of InternetConfig. Also provides a mac-specific implementation of proxy_bypass. ........ r63162 | eric.smith | 2008-05-12 10:00:01 -0400 (Mon, 12 May 2008) | 1 line Added 'n' presentation type for integers. ........ r63164 | georg.brandl | 2008-05-12 12:26:52 -0400 (Mon, 12 May 2008) | 2 lines #1713041: fix pprint's handling of maximum depth. ........ r63170 | georg.brandl | 2008-05-12 12:53:42 -0400 (Mon, 12 May 2008) | 2 lines Fix parameter name for enumerate(). ........ r63173 | georg.brandl | 2008-05-12 13:01:58 -0400 (Mon, 12 May 2008) | 2 lines #2766: remove code without effect. ........ r63174 | georg.brandl | 2008-05-12 13:04:10 -0400 (Mon, 12 May 2008) | 3 lines #2767: don't clear globs in run() call, since they could be needed in tearDown, which clears them at the end. ........ r63175 | georg.brandl | 2008-05-12 13:14:51 -0400 (Mon, 12 May 2008) | 2 lines #1760: try-except-finally is one statement since PEP 341. ........ r63186 | amaury.forgeotdarc | 2008-05-12 17:30:24 -0400 (Mon, 12 May 2008) | 2 lines Sync code with documentation, and remove Win95 support in winsound module. ........ r63189 | amaury.forgeotdarc | 2008-05-12 18:21:39 -0400 (Mon, 12 May 2008) | 3 lines Adapt test_pyclbr to the new version of urllib.py: The new mac-specific functions must be ignored. ........
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/functions.rst17
-rw-r--r--Doc/library/pprint.rst5
-rw-r--r--Doc/reference/executionmodel.rst8
-rw-r--r--Doc/whatsnew/2.6.rst6
4 files changed, 18 insertions, 18 deletions
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst
index 9ccc59c..582abbf 100644
--- a/Doc/library/functions.rst
+++ b/Doc/library/functions.rst
@@ -325,14 +325,15 @@ are always available. They are listed here in alphabetical order.
< abs(b)``.
-.. function:: enumerate(iterable)
-
- 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
- zero) and the corresponding value obtained from iterating over *iterable*.
- :func:`enumerate` is useful for obtaining an indexed series: ``(0, seq[0])``,
- ``(1, seq[1])``, ``(2, seq[2])``, .... For example:
+.. function:: enumerate(sequence)
+
+ Return an enumerate object. *sequence* 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 zero) and the corresponding value obtained
+ from iterating over *iterable*. :func:`enumerate` is useful for obtaining an
+ indexed series: ``(0, seq[0])``, ``(1, seq[1])``, ``(2, seq[2])``, .... For
+ example:
>>> for i, season in enumerate(['Spring', 'Summer', 'Fall', 'Winter')]:
... print(i, season)
diff --git a/Doc/library/pprint.rst b/Doc/library/pprint.rst
index 8c28879..940e4c4 100644
--- a/Doc/library/pprint.rst
+++ b/Doc/library/pprint.rst
@@ -60,8 +60,7 @@ The :mod:`pprint` module defines one class:
... ('parrot', ('fresh fruit',))))))))
>>> pp = pprint.PrettyPrinter(depth=6)
>>> pp.pprint(tup)
- ('spam',
- ('eggs', ('lumberjack', ('knights', ('ni', ('dead', ('parrot', (...,))))))))
+ ('spam', ('eggs', ('lumberjack', ('knights', ('ni', ('dead', (...)))))))
The :class:`PrettyPrinter` class supports several derivative functions:
@@ -208,7 +207,7 @@ This example demonstrates several uses of the :func:`pprint` function and its pa
['cccccccccccccccccccc', 'dddddddddddddddddddd']]
>>> pprint.pprint(stuff, depth=3)
['aaaaaaaaaa',
- ('spam', ('eggs', ('lumberjack', (...)))),
+ ('spam', ('eggs', (...))),
['aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'],
['cccccccccccccccccccc', 'dddddddddddddddddddd']]
>>> pprint.pprint(stuff, width=60)
diff --git a/Doc/reference/executionmodel.rst b/Doc/reference/executionmodel.rst
index 43515d9..fefc146 100644
--- a/Doc/reference/executionmodel.rst
+++ b/Doc/reference/executionmodel.rst
@@ -198,10 +198,10 @@ the code block where the error occurred.
The Python interpreter raises an exception when it detects a run-time error
(such as division by zero). A Python program can also explicitly raise an
exception with the :keyword:`raise` statement. Exception handlers are specified
-with the :keyword:`try` ... :keyword:`except` statement. The :keyword:`try` ...
-:keyword:`finally` statement specifies cleanup code which does not handle the
-exception, but is executed whether an exception occurred or not in the preceding
-code.
+with the :keyword:`try` ... :keyword:`except` statement. The :keyword:`finally`
+clause of such a statement can be used to specify cleanup code which does not
+handle the exception, but is executed whether an exception occurred or not in
+the preceding code.
.. index:: single: termination model
diff --git a/Doc/whatsnew/2.6.rst b/Doc/whatsnew/2.6.rst
index 9708c67..c39c80a 100644
--- a/Doc/whatsnew/2.6.rst
+++ b/Doc/whatsnew/2.6.rst
@@ -627,9 +627,9 @@ docs), but here's a sample::
'g' - General format. This prints the number as a fixed-point
number, unless the number is too large, in which case
it switches to 'e' exponent notation.
- 'n' - Number. This is the same as 'g', except that it uses the
- current locale setting to insert the appropriate
- number separator characters.
+ 'n' - Number. This is the same as 'g' (for floats) or 'd' (for
+ integers), except that it uses the current locale setting to
+ insert the appropriate number separator characters.
'%' - Percentage. Multiplies the number by 100 and displays
in fixed ('f') format, followed by a percent sign.