[Python-checkins] r75784 - in python/branches/release26-maint: Doc/c-api/arg.rst Doc/c-api/float.rst Doc/c-api/int.rst Doc/c-api/method.rst Doc/c-api/sys.rst Doc/c-api/tuple.rst Doc/c-api/type.rst Doc/c-api/unicode.rst Doc/copyright.rst Doc/howto/urllib2.rst Doc/library/cgi.rst Doc/library/intro.rst Doc/library/re.rst Doc/library/stdtypes.rst Doc/library/subprocess.rst Doc/library/warnings.rst Doc/library/webbrowser.rst Doc/library/xml.etree.elementtree.rst Doc/tutorial/errors.rst Doc/tutorial/inputoutput.rst
georg.brandl
python-checkins at python.org
Tue Oct 27 15:34:22 CET 2009
Author: georg.brandl
Date: Tue Oct 27 15:34:21 2009
New Revision: 75784
Log:
Merged revisions 74008,74021-74022,74074-74075,74077,74148,74179,74188,74192-74194,74200,74205 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r74008 | benjamin.peterson | 2009年07月15日 02:46:42 +0200 (Mi, 15 Jul 2009) | 1 line
update year
........
r74021 | georg.brandl | 2009年07月16日 09:33:04 +0200 (Do, 16 Jul 2009) | 1 line
#6486: start with built in functions rather than "built in objects".
........
r74022 | georg.brandl | 2009年07月16日 09:38:35 +0200 (Do, 16 Jul 2009) | 1 line
#6481: fix typo in os.system() replacement.
........
r74074 | georg.brandl | 2009年07月18日 11:03:10 +0200 (Sa, 18 Jul 2009) | 1 line
#6513: fix example code: warning categories are classes, not instances.
........
r74075 | georg.brandl | 2009年07月18日 11:06:31 +0200 (Sa, 18 Jul 2009) | 1 line
#6505: fix typos.
........
r74077 | georg.brandl | 2009年07月18日 11:43:40 +0200 (Sa, 18 Jul 2009) | 1 line
#6489: fix an ambiguity in getiterator() documentation.
........
r74148 | ezio.melotti | 2009年07月21日 22:18:27 +0200 (Di, 21 Jul 2009) | 1 line
#6536 fixed typo
........
r74179 | ezio.melotti | 2009年07月22日 23:08:49 +0200 (Mi, 22 Jul 2009) | 1 line
#6423 has_key -> in
........
r74188 | benjamin.peterson | 2009年07月23日 16:25:31 +0200 (Do, 23 Jul 2009) | 1 line
use bools
........
r74192 | georg.brandl | 2009年07月24日 18:28:38 +0200 (Fr, 24 Jul 2009) | 1 line
Fix arg types of et#.
........
r74193 | georg.brandl | 2009年07月24日 18:46:38 +0200 (Fr, 24 Jul 2009) | 1 line
Dont put "void" in signature for nullary functions.
........
r74194 | georg.brandl | 2009年07月24日 22:09:46 +0200 (Fr, 24 Jul 2009) | 1 line
#6564: fix section about the two raise syntaxes.
........
r74200 | georg.brandl | 2009年07月25日 15:02:15 +0200 (Sa, 25 Jul 2009) | 1 line
#6571: add index entries for more operators.
........
r74205 | georg.brandl | 2009年07月26日 15:36:39 +0200 (So, 26 Jul 2009) | 1 line
#6576: fix cross-refs in re docs.
........
Modified:
python/branches/release26-maint/ (props changed)
python/branches/release26-maint/Doc/c-api/arg.rst
python/branches/release26-maint/Doc/c-api/float.rst
python/branches/release26-maint/Doc/c-api/int.rst
python/branches/release26-maint/Doc/c-api/method.rst
python/branches/release26-maint/Doc/c-api/sys.rst
python/branches/release26-maint/Doc/c-api/tuple.rst
python/branches/release26-maint/Doc/c-api/type.rst
python/branches/release26-maint/Doc/c-api/unicode.rst
python/branches/release26-maint/Doc/copyright.rst
python/branches/release26-maint/Doc/howto/urllib2.rst
python/branches/release26-maint/Doc/library/cgi.rst
python/branches/release26-maint/Doc/library/intro.rst
python/branches/release26-maint/Doc/library/re.rst
python/branches/release26-maint/Doc/library/stdtypes.rst
python/branches/release26-maint/Doc/library/subprocess.rst
python/branches/release26-maint/Doc/library/warnings.rst
python/branches/release26-maint/Doc/library/webbrowser.rst
python/branches/release26-maint/Doc/library/xml.etree.elementtree.rst
python/branches/release26-maint/Doc/tutorial/errors.rst
python/branches/release26-maint/Doc/tutorial/inputoutput.rst
Modified: python/branches/release26-maint/Doc/c-api/arg.rst
==============================================================================
--- python/branches/release26-maint/Doc/c-api/arg.rst (original)
+++ python/branches/release26-maint/Doc/c-api/arg.rst Tue Oct 27 15:34:21 2009
@@ -136,7 +136,7 @@
In both cases, *\*buffer_length* is set to the length of the encoded data
without the trailing NUL byte.
-``et#`` (string, Unicode object or character buffer compatible object) [const char \*encoding, char \*\*buffer]
+``et#`` (string, Unicode object or character buffer compatible object) [const char \*encoding, char \*\*buffer, int \*buffer_length]
Same as ``es#`` except that string objects are passed through without
recoding them. Instead, the implementation assumes that the string object
uses the encoding passed in as parameter.
Modified: python/branches/release26-maint/Doc/c-api/float.rst
==============================================================================
--- python/branches/release26-maint/Doc/c-api/float.rst (original)
+++ python/branches/release26-maint/Doc/c-api/float.rst Tue Oct 27 15:34:21 2009
@@ -72,21 +72,21 @@
.. versionadded:: 2.6
-.. cfunction:: double PyFloat_GetMax(void)
+.. cfunction:: double PyFloat_GetMax()
Return the maximum representable finite float *DBL_MAX* as C :ctype:`double`.
.. versionadded:: 2.6
-.. cfunction:: double PyFloat_GetMin(void)
+.. cfunction:: double PyFloat_GetMin()
Return the minimum normalized positive float *DBL_MIN* as C :ctype:`double`.
.. versionadded:: 2.6
-.. cfunction:: int PyFloat_ClearFreeList(void)
+.. cfunction:: int PyFloat_ClearFreeList()
Clear the float free list. Return the number of items that could not
be freed.
Modified: python/branches/release26-maint/Doc/c-api/int.rst
==============================================================================
--- python/branches/release26-maint/Doc/c-api/int.rst (original)
+++ python/branches/release26-maint/Doc/c-api/int.rst Tue Oct 27 15:34:21 2009
@@ -131,7 +131,7 @@
(:const:`LONG_MAX`, as defined in the system header files).
-.. cfunction:: int PyInt_ClearFreeList(void)
+.. cfunction:: int PyInt_ClearFreeList()
Clear the integer free list. Return the number of items that could not
be freed.
Modified: python/branches/release26-maint/Doc/c-api/method.rst
==============================================================================
--- python/branches/release26-maint/Doc/c-api/method.rst (original)
+++ python/branches/release26-maint/Doc/c-api/method.rst Tue Oct 27 15:34:21 2009
@@ -65,7 +65,7 @@
Macro version of :cfunc:`PyMethod_Self` which avoids error checking.
-.. cfunction:: int PyMethod_ClearFreeList(void)
+.. cfunction:: int PyMethod_ClearFreeList()
Clear the free list. Return the total number of freed items.
Modified: python/branches/release26-maint/Doc/c-api/sys.rst
==============================================================================
--- python/branches/release26-maint/Doc/c-api/sys.rst (original)
+++ python/branches/release26-maint/Doc/c-api/sys.rst Tue Oct 27 15:34:21 2009
@@ -80,7 +80,7 @@
case *name* is deleted from the sys module. Returns ``0`` on success, ``-1``
on error.
-.. cfunction:: void PySys_ResetWarnOptions(void)
+.. cfunction:: void PySys_ResetWarnOptions()
Reset :data:`sys.warnoptions` to an empty list.
Modified: python/branches/release26-maint/Doc/c-api/tuple.rst
==============================================================================
--- python/branches/release26-maint/Doc/c-api/tuple.rst (original)
+++ python/branches/release26-maint/Doc/c-api/tuple.rst Tue Oct 27 15:34:21 2009
@@ -157,7 +157,7 @@
require changes in your code for properly supporting 64-bit systems.
-.. cfunction:: int PyTuple_ClearFreeList(void)
+.. cfunction:: int PyTuple_ClearFreeList()
Clear the free list. Return the total number of freed items.
Modified: python/branches/release26-maint/Doc/c-api/type.rst
==============================================================================
--- python/branches/release26-maint/Doc/c-api/type.rst (original)
+++ python/branches/release26-maint/Doc/c-api/type.rst Tue Oct 27 15:34:21 2009
@@ -35,7 +35,7 @@
.. versionadded:: 2.2
-.. cfunction:: unsigned int PyType_ClearCache(void)
+.. cfunction:: unsigned int PyType_ClearCache()
Clear the internal lookup cache. Return the current version tag.
Modified: python/branches/release26-maint/Doc/c-api/unicode.rst
==============================================================================
--- python/branches/release26-maint/Doc/c-api/unicode.rst (original)
+++ python/branches/release26-maint/Doc/c-api/unicode.rst Tue Oct 27 15:34:21 2009
@@ -98,12 +98,13 @@
:ctype:`PyUnicodeObject` (not checked).
-.. cfunction:: int PyUnicode_ClearFreeList(void)
+.. cfunction:: int PyUnicode_ClearFreeList()
Clear the free list. Return the total number of freed items.
.. versionadded:: 2.6
+
Unicode provides many different character properties. The most often needed ones
are available through these macros which are mapped to C functions depending on
the Python configuration.
Modified: python/branches/release26-maint/Doc/copyright.rst
==============================================================================
--- python/branches/release26-maint/Doc/copyright.rst (original)
+++ python/branches/release26-maint/Doc/copyright.rst Tue Oct 27 15:34:21 2009
@@ -4,7 +4,7 @@
Python and this documentation is:
-Copyright © 2001-2008 Python Software Foundation. All rights reserved.
+Copyright © 2001-2009 Python Software Foundation. All rights reserved.
Copyright © 2000 BeOpen.com. All rights reserved.
Modified: python/branches/release26-maint/Doc/howto/urllib2.rst
==============================================================================
--- python/branches/release26-maint/Doc/howto/urllib2.rst (original)
+++ python/branches/release26-maint/Doc/howto/urllib2.rst Tue Oct 27 15:34:21 2009
@@ -488,7 +488,7 @@
.. note::
- In the above example we only supplied our ``HHTPBasicAuthHandler`` to
+ In the above example we only supplied our ``HTTPBasicAuthHandler`` to
``build_opener``. By default openers have the handlers for normal situations
-- ``ProxyHandler``, ``UnknownHandler``, ``HTTPHandler``,
``HTTPDefaultErrorHandler``, ``HTTPRedirectHandler``, ``FTPHandler``,
Modified: python/branches/release26-maint/Doc/library/cgi.rst
==============================================================================
--- python/branches/release26-maint/Doc/library/cgi.rst (original)
+++ python/branches/release26-maint/Doc/library/cgi.rst Tue Oct 27 15:34:21 2009
@@ -91,12 +91,13 @@
various environment variables set according to the CGI standard). Since it may
consume standard input, it should be instantiated only once.
-The :class:`FieldStorage` instance can be indexed like a Python dictionary, and
-also supports the standard dictionary methods :meth:`has_key` and :meth:`keys`.
-The built-in :func:`len` is also supported. Form fields containing empty
-strings are ignored and do not appear in the dictionary; to keep such values,
-provide a true value for the optional *keep_blank_values* keyword parameter when
-creating the :class:`FieldStorage` instance.
+The :class:`FieldStorage` instance can be indexed like a Python dictionary.
+It allows membership testing with the :keyword:`in` operator, and also supports
+the standard dictionary method :meth:`keys` and the built-in function
+:func:`len`. Form fields containing empty strings are ignored and do not appear
+in the dictionary; to keep such values, provide a true value for the optional
+*keep_blank_values* keyword parameter when creating the :class:`FieldStorage`
+instance.
For instance, the following code (which assumes that the
:mailheader:`Content-Type` header and blank line have already been printed)
@@ -104,7 +105,7 @@
string::
form = cgi.FieldStorage()
- if not (form.has_key("name") and form.has_key("addr")):
+ if "name" not in form or "addr" not in form:
print "<H1>Error</H1>"
print "Please fill in the name and addr fields."
return
Modified: python/branches/release26-maint/Doc/library/intro.rst
==============================================================================
--- python/branches/release26-maint/Doc/library/intro.rst (original)
+++ python/branches/release26-maint/Doc/library/intro.rst Tue Oct 27 15:34:21 2009
@@ -44,8 +44,9 @@
function, module or term in the index (in the back). And finally, if you enjoy
learning about random subjects, you choose a random page number (see module
:mod:`random`) and read a section or two. Regardless of the order in which you
-read the sections of this manual, it helps to start with chapter :ref:`builtin`,
-as the remainder of the manual assumes familiarity with this material.
+read the sections of this manual, it helps to start with chapter
+:ref:`built-in-funcs`, as the remainder of the manual assumes familiarity with
+this material.
Let the show begin!
Modified: python/branches/release26-maint/Doc/library/re.rst
==============================================================================
--- python/branches/release26-maint/Doc/library/re.rst (original)
+++ python/branches/release26-maint/Doc/library/re.rst Tue Oct 27 15:34:21 2009
@@ -216,7 +216,7 @@
flags are described in :ref:`contents-of-module-re`.) This
is useful if you wish to include the flags as part of the regular
expression, instead of passing a *flag* argument to the
- :func:`compile` function.
+ :func:`re.compile` function.
Note that the ``(?x)`` flag changes how the expression is parsed. It should be
used first in the expression string, or after one or more whitespace characters.
@@ -443,9 +443,9 @@
result = re.match(pattern, string)
- but using :func:`compile` and saving the resulting regular expression object
- for reuse is more efficient when the expression will be used several times
- in a single program.
+ but using :func:`re.compile` and saving the resulting regular expression
+ object for reuse is more efficient when the expression will be used several
+ times in a single program.
.. note::
@@ -532,7 +532,7 @@
.. note::
- If you want to locate a match anywhere in *string*, use :meth:`search`
+ If you want to locate a match anywhere in *string*, use :func:`search`
instead.
@@ -686,8 +686,8 @@
.. note::
- If you want to locate a match anywhere in *string*, use :meth:`search`
- instead.
+ If you want to locate a match anywhere in *string*, use
+ :meth:`~RegexObject.search` instead.
The optional second parameter *pos* gives an index in the string where the
search is to start; it defaults to ``0``. This is not completely equivalent to
@@ -716,7 +716,7 @@
is different from finding a zero-length match at some point in the string.
The optional *pos* and *endpos* parameters have the same meaning as for the
- :meth:`match` method.
+ :meth:`~RegexObject.match` method.
.. method:: RegexObject.split(string[, maxsplit=0])
@@ -780,10 +780,10 @@
.. method:: MatchObject.expand(template)
Return the string obtained by doing backslash substitution on the template
- string *template*, as done by the :meth:`sub` method. Escapes such as ``\n`` are
- converted to the appropriate characters, and numeric backreferences (``1円``,
- ``2円``) and named backreferences (``\g<1>``, ``\g<name>``) are replaced by the
- contents of the corresponding group.
+ string *template*, as done by the :meth:`~RegexObject.sub` method. Escapes
+ such as ``\n`` are converted to the appropriate characters, and numeric
+ backreferences (``1円``, ``2円``) and named backreferences (``\g<1>``,
+ ``\g<name>``) are replaced by the contents of the corresponding group.
.. method:: MatchObject.group([group1, ...])
@@ -907,16 +907,16 @@
.. attribute:: MatchObject.pos
- The value of *pos* which was passed to the :func:`search` or :func:`match`
- method of the :class:`RegexObject`. This is the index into the string at which
- the RE engine started looking for a match.
+ The value of *pos* which was passed to the :meth:`~RegexObject.search` or
+ :meth:`~RegexObject.match` method of the :class:`RegexObject`. This is the
+ index into the string at which the RE engine started looking for a match.
.. attribute:: MatchObject.endpos
- The value of *endpos* which was passed to the :func:`search` or :func:`match`
- method of the :class:`RegexObject`. This is the index into the string beyond
- which the RE engine will not go.
+ The value of *endpos* which was passed to the :meth:`~RegexObject.search` or
+ :meth:`~RegexObject.match` method of the :class:`RegexObject`. This is the
+ index into the string beyond which the RE engine will not go.
.. attribute:: MatchObject.lastindex
@@ -936,13 +936,15 @@
.. attribute:: MatchObject.re
- The regular expression object whose :meth:`match` or :meth:`search` method
- produced this :class:`MatchObject` instance.
+ The regular expression object whose :meth:`~RegexObject.match` or
+ :meth:`~RegexObject.search` method produced this :class:`MatchObject`
+ instance.
.. attribute:: MatchObject.string
- The string passed to :func:`match` or :func:`search`.
+ The string passed to :meth:`~RegexObject.match` or
+ :meth:`~RegexObject.search`.
Examples
@@ -987,8 +989,9 @@
>>> displaymatch(pair.match("354aa")) # Pair of aces.
"<Match: '354aa', groups=('a',)>"
-To find out what card the pair consists of, one could use the :func:`group`
-method of :class:`MatchObject` in the following manner:
+To find out what card the pair consists of, one could use the
+:meth:`~MatchObject.group` method of :class:`MatchObject` in the following
+manner:
.. doctest::
Modified: python/branches/release26-maint/Doc/library/stdtypes.rst
==============================================================================
--- python/branches/release26-maint/Doc/library/stdtypes.rst (original)
+++ python/branches/release26-maint/Doc/library/stdtypes.rst Tue Oct 27 15:34:21 2009
@@ -129,7 +129,17 @@
Comparisons
===========
-.. index:: pair: chaining; comparisons
+.. index::
+ pair: chaining; comparisons
+ pair: operator; comparison
+ operator: ==
+ operator: <
+ operator: <=
+ operator: >
+ operator: >=
+ operator: !=
+ operator: is
+ operator: is not
Comparison operations are supported by all objects. They all have the same
priority (which is higher than that of the Boolean operations). Comparisons can
@@ -159,17 +169,6 @@
| ``is not`` | negated object identity | |
+------------+-------------------------+-------+
-.. index::
- pair: operator; comparison
- operator: ==
- operator: <
- operator: <=
- operator: >
- operator: >=
- operator: !=
- operator: is
- operator: is not
-
Notes:
(1)
@@ -262,6 +261,13 @@
builtin: long
builtin: float
builtin: complex
+ operator: +
+ operator: -
+ operator: *
+ operator: /
+ operator: //
+ operator: %
+ operator: **
Python fully supports mixed arithmetic: when a binary arithmetic operator has
operands of different numeric types, the operand with the "narrower" type is
@@ -394,7 +400,15 @@
Bit-string Operations on Integer Types
--------------------------------------
-.. _bit-string-operations:
+.. index::
+ triple: operations on; integer; types
+ pair: bit-string; operations
+ pair: shifting; operations
+ pair: masking; operations
+ operator: ^
+ operator: &
+ operator: <<
+ operator: >>
Plain and long integer types support additional operations that make sense only
for bit-strings. Negative numbers are treated as their 2's complement value
@@ -426,12 +440,6 @@
| ``~x`` | the bits of *x* inverted | |
+------------+--------------------------------+----------+
-.. index::
- triple: operations on; integer; types
- pair: bit-string; operations
- pair: shifting; operations
- pair: masking; operations
-
Notes:
(1)
Modified: python/branches/release26-maint/Doc/library/subprocess.rst
==============================================================================
--- python/branches/release26-maint/Doc/library/subprocess.rst (original)
+++ python/branches/release26-maint/Doc/library/subprocess.rst Tue Oct 27 15:34:21 2009
@@ -369,7 +369,7 @@
sts = os.system("mycmd" + " myarg")
==>
p = Popen("mycmd" + " myarg", shell=True)
- sts = os.waitpid(p.pid, 0)
+ sts = os.waitpid(p.pid, 0)[1]
Notes:
Modified: python/branches/release26-maint/Doc/library/warnings.rst
==============================================================================
--- python/branches/release26-maint/Doc/library/warnings.rst (original)
+++ python/branches/release26-maint/Doc/library/warnings.rst Tue Oct 27 15:34:21 2009
@@ -204,7 +204,7 @@
fxn()
# Verify some things
assert len(w) == 1
- assert isinstance(w[-1].category, DeprecationWarning)
+ assert issubclass(w[-1].category, DeprecationWarning)
assert "deprecated" in str(w[-1].message)
One can also cause all warnings to be exceptions by using ``error`` instead of
Modified: python/branches/release26-maint/Doc/library/webbrowser.rst
==============================================================================
--- python/branches/release26-maint/Doc/library/webbrowser.rst (original)
+++ python/branches/release26-maint/Doc/library/webbrowser.rst Tue Oct 27 15:34:21 2009
@@ -46,14 +46,14 @@
The following functions are defined:
-.. function:: open(url[, new=0[, autoraise=1]])
+.. function:: open(url[, new=0[, autoraise=True]])
- Display *url* using the default browser. If *new* is 0, the *url* is opened in
- the same browser window if possible. If *new* is 1, a new browser window is
- opened if possible. If *new* is 2, a new browser page ("tab") is opened if
- possible. If *autoraise* is true, the window is raised if possible (note that
- under many window managers this will occur regardless of the setting of this
- variable).
+ Display *url* using the default browser. If *new* is 0, the *url* is opened
+ in the same browser window if possible. If *new* is 1, a new browser window
+ is opened if possible. If *new* is 2, a new browser page ("tab") is opened
+ if possible. If *autoraise* is ``True``, the window is raised if possible
+ (note that under many window managers this will occur regardless of the
+ setting of this variable).
Note that on some platforms, trying to open a filename using this function,
may work and start the operating system's associated program. However, this
@@ -180,7 +180,7 @@
module-level convenience functions:
-.. method:: controller.open(url[, new[, autoraise=1]])
+.. method:: controller.open(url[, new[, autoraise=True]])
Display *url* using the browser handled by this controller. If *new* is 1, a new
browser window is opened if possible. If *new* is 2, a new browser page ("tab")
Modified: python/branches/release26-maint/Doc/library/xml.etree.elementtree.rst
==============================================================================
--- python/branches/release26-maint/Doc/library/xml.etree.elementtree.rst (original)
+++ python/branches/release26-maint/Doc/library/xml.etree.elementtree.rst Tue Oct 27 15:34:21 2009
@@ -262,9 +262,9 @@
.. method:: Element.getiterator([tag=None])
Creates a tree iterator with the current element as the root. The iterator
- iterates over this element and all elements below it that match the given tag.
- If tag is ``None`` or ``'*'`` then all elements are iterated over. Returns an
- iterable that provides element objects in document (depth first) order.
+ iterates over this element and all elements below it, in document (depth first)
+ order. If *tag* is not ``None`` or ``'*'``, only elements whose tag equals
+ *tag* are returned from the iterator.
.. method:: Element.insert(index, element)
Modified: python/branches/release26-maint/Doc/tutorial/errors.rst
==============================================================================
--- python/branches/release26-maint/Doc/tutorial/errors.rst (original)
+++ python/branches/release26-maint/Doc/tutorial/errors.rst Tue Oct 27 15:34:21 2009
@@ -221,9 +221,11 @@
File "<stdin>", line 1, in ?
NameError: HiThere
-The sole argument to :keyword:`raise` indicates the exception to be raised.
-This must be either an exception instance or an exception class (a class that
-derives from :class:`Exception`).
+The argument to :keyword:`raise` is an exception class or instance to be
+raised. There is a deprecated alternate syntax that separates class and
+constructor arguments; the above could be written as ``raise NameError,
+'HiThere'``. Since it once was the only one available, the latter form is
+prevalent in older code.
If you need to determine whether an exception was raised but don't intend to
handle it, a simpler form of the :keyword:`raise` statement allows you to
Modified: python/branches/release26-maint/Doc/tutorial/inputoutput.rst
==============================================================================
--- python/branches/release26-maint/Doc/tutorial/inputoutput.rst (original)
+++ python/branches/release26-maint/Doc/tutorial/inputoutput.rst Tue Oct 27 15:34:21 2009
@@ -148,9 +148,9 @@
... other='Georg')
The story of Bill, Manfred, and Georg.
-An optional ``':'`` and format specifier can follow the field name. This also
+An optional ``':'`` and format specifier can follow the field name. This allows
greater control over how the value is formatted. The following example
-truncates the Pi to three places after the decimal.
+truncates Pi to three places after the decimal.
>>> import math
>>> print 'The value of PI is approximately {0:.3f}.'.format(math.pi)
@@ -204,8 +204,8 @@
The value of PI is approximately 3.142.
Since :meth:`str.format` is quite new, a lot of Python code still uses the ``%``
-operator. However, because this old style of formatting will eventually removed
-from the language :meth:`str.format` should generally be used.
+operator. However, because this old style of formatting will eventually be
+removed from the language, :meth:`str.format` should generally be used.
More information can be found in the :ref:`string-formatting` section.
More information about the Python-checkins
mailing list