diff options
author | Raymond Hettinger <python@rcn.com> | 2009-04-04 11:08:48 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2009-04-04 11:08:48 (GMT) |
commit | e7ec57dcfa37cefdc779f0666cacd6448edcad4d (patch) | |
tree | 480f431f3a113beabaec925a8629b15400792972 /Doc | |
parent | 1f251a0d30ca82922c610ce55e3a4379eb943f62 (diff) | |
download | cpython-e7ec57dcfa37cefdc779f0666cacd6448edcad4d.zip cpython-e7ec57dcfa37cefdc779f0666cacd6448edcad4d.tar.gz cpython-e7ec57dcfa37cefdc779f0666cacd6448edcad4d.tar.bz2 |
More updates to whatsnew
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/whatsnew/3.1.rst | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/Doc/whatsnew/3.1.rst b/Doc/whatsnew/3.1.rst index 2d3b20b..c4fcb34 100644 --- a/Doc/whatsnew/3.1.rst +++ b/Doc/whatsnew/3.1.rst @@ -189,6 +189,28 @@ Some smaller changes made to the core Python language are: (Contributed by Raymond Hettinger and Mark Dickinson.) +* The fields in :func:`format` strings can now be automatically + numbered:: + + >>> 'Sir {} of {}'.format('Gallahad', 'Camelot') + 'Sir Gallahad of Camelot' + + Formerly, the string would have required numbered fields such as: + ``'Sir {0} of {1}'``. + + (Contributed by Eric Smith; :issue:`5237`.) + +* The :mod:`itertools` module grew two new functions. The + :func:`itertools.combinations_with_replacement` function is one of + four for generating combinatorics including permutations and Cartesian + products. The :func:`itertools.compress` function mimics its namesake + from APL. Also, the existing :func:`itertools.count` function now has + an optional *step* argument and can accept any type of counting + sequence including :class:`fractions.Fraction` and + :class:`decimal.Decimal`. + + (Contributed by Raymond Hettinger.) + .. ====================================================================== @@ -213,6 +235,13 @@ Major performance enhancements have been added: (Contributed by Antoine Pitrou, :issue:`4753`.) +* Add a heuristic so that tuples and dicts containing only untrackable objects + are not tracked by the garbage collector. This can reduce the size of + collections and therefore the garbage collection overhead on long-running + programs, depending on their particular use of datatypes. + + (Contributed by Antoine Pitrou, :issue:`4688`.) + XXX The JSON module is getting a C extension for speed. .. ====================================================================== |