summaryrefslogtreecommitdiffstats
path: root/Misc/NEWS
diff options
context:
space:
mode:
authorEric Smith <eric@trueblade.com>2009-03-14 11:57:26 (GMT)
committerEric Smith <eric@trueblade.com>2009-03-14 11:57:26 (GMT)
commit6f42edb6821462c9ce02c6c4e2f57731b43956ad (patch)
tree22a648f118e175d637901f3575d3549e975eb445 /Misc/NEWS
parentfeeafff0529c8fa0b5ab6a3086464cce8fd1b3fc (diff)
downloadcpython-6f42edb6821462c9ce02c6c4e2f57731b43956ad.zip
cpython-6f42edb6821462c9ce02c6c4e2f57731b43956ad.tar.gz
cpython-6f42edb6821462c9ce02c6c4e2f57731b43956ad.tar.bz2
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/NEWS3
1 files changed, 3 insertions, 0 deletions
diff --git a/Misc/NEWS b/Misc/NEWS
index d5ddd10..9432295 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -12,6 +12,9 @@ What's New in Python 2.7 alpha 1
Core and Builtins
-----------------
+- Issue #5237: Allow auto-numbered fields in str.format(). For
+ example: '{} {}'.format(1, 2) == '1 2'.
+
- Issue #3652: Make the 'line' argument for warnings.showwarning() a
requirement. Means the DeprecationWarning from Python 2.6 can go away.