summaryrefslogtreecommitdiffstats
path: root/Doc/whatsnew/2.7.rst
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2009-04-11 20:58:12 (GMT)
committerBenjamin Peterson <benjamin@python.org>2009-04-11 20:58:12 (GMT)
commit3f96a8790260ac0af552684c11105923cfe8012b (patch)
treeb7cc78abd05388e7923a6ac3f9d3e6f92d8a8c6a /Doc/whatsnew/2.7.rst
parentf47ed4a01462b304199c806d3d1a4d0a5e311e2f (diff)
downloadcpython-3f96a8790260ac0af552684c11105923cfe8012b.zip
cpython-3f96a8790260ac0af552684c11105923cfe8012b.tar.gz
cpython-3f96a8790260ac0af552684c11105923cfe8012b.tar.bz2
Merged revisions 71498 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r71498 | benjamin.peterson | 2009-04-11 15:27:15 -0500 (Sat, 11 Apr 2009) | 1 line fix markup ........
Diffstat (limited to 'Doc/whatsnew/2.7.rst')
-rw-r--r--Doc/whatsnew/2.7.rst19
1 files changed, 9 insertions, 10 deletions
diff --git a/Doc/whatsnew/2.7.rst b/Doc/whatsnew/2.7.rst
index 55d9a2b..3b98cc2 100644
--- a/Doc/whatsnew/2.7.rst
+++ b/Doc/whatsnew/2.7.rst
@@ -88,22 +88,21 @@ Other Language Changes
Some smaller changes made to the core Python language are:
-* The string :method:`format` method now supports automatic numbering
- of the replacement fields. This makes using :meth:`format`
- more closely resemble using ``%s`` formatting::
+* :meth:`str.format` method now supports automatic numbering of the replacement
+ fields. This makes using :meth:`str.format` more closely resemble using
+ ``%s`` formatting::
>>> '{}:{}:{}'.format(2009, 04, 'Sunday')
'2009:4:Sunday'
>>> '{}:{}:{day}'.format(2009, 4, day='Sunday')
'2009:4:Sunday'
- The auto-numbering takes the fields from left to right, so the first
- ``{...}`` specifier will use the first argument to :meth:`format`,
- the next specifier will use the next argument, and so on. You can't
- mix auto-numbering and explicit numbering -- either number all of
- your specifier fields or none of them -- but you can mix
- auto-numbering and named fields, as in the second example above.
- (Contributed by XXX; :issue`5237`.)
+ The auto-numbering takes the fields from left to right, so the first ``{...}``
+ specifier will use the first argument to :meth:`str.format`, the next
+ specifier will use the next argument, and so on. You can't mix auto-numbering
+ and explicit numbering -- either number all of your specifier fields or none
+ of them -- but you can mix auto-numbering and named fields, as in the second
+ example above. (Contributed by XXX; :issue`5237`.)
* The :func:`int` and :func:`long` types gained a ``bit_length``
method that returns the number of bits necessary to represent