diff options
author | Eric Smith <eric@trueblade.com> | 2009-03-14 12:29:34 (GMT) |
---|---|---|
committer | Eric Smith <eric@trueblade.com> | 2009-03-14 12:29:34 (GMT) |
commit | 8ec90443f57c13e895a43b0f62bdb73a6b30d552 (patch) | |
tree | 1eb0a716e9e6bf041944c2c27fe111de820d9427 /Misc/NEWS | |
parent | 350370c25fd1259199bb18fbce9fa447cd02ddf1 (diff) | |
download | cpython-8ec90443f57c13e895a43b0f62bdb73a6b30d552.zip cpython-8ec90443f57c13e895a43b0f62bdb73a6b30d552.tar.gz cpython-8ec90443f57c13e895a43b0f62bdb73a6b30d552.tar.bz2 |
Merged revisions 70364 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r70364 | eric.smith | 2009-03-14 07:57:26 -0400 (Sat, 14 Mar 2009) | 17 lines
Issue 5237, Allow auto-numbered replacement fields in str.format() strings.
For simple uses for str.format(), this makes the typing easier. Hopfully this
will help in the adoption of str.format().
For example:
'The {} is {}'.format('sky', 'blue')
You can mix and matcth auto-numbering and named replacement fields:
'The {} is {color}'.format('sky', color='blue')
But you can't mix and match auto-numbering and specified numbering:
'The {0} is {}'.format('sky', 'blue')
ValueError: cannot switch from manual field specification to automatic field numbering
Will port to 3.1.
........
Diffstat (limited to 'Misc/NEWS')
-rw-r--r-- | Misc/NEWS | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -12,6 +12,9 @@ What's New in Python 3.1 alpha 2? Core and Builtins ----------------- +- Issue #5237: Allow auto-numbered fields in str.format(). For + example: '{} {}'.format(1, 2) == '1 2'. + - Issue #5392: when a very low recursion limit was set, the interpreter would abort with a fatal error after the recursion limit was hit twice. @@ -33,6 +36,7 @@ What's New in Python 3.1 alpha 1 Core and Builtins ----------------- +======= - The io module has been reimplemented in C for speed. - Give dict views an informative __repr__. |