From: Raymond Hettinger Date: Sat, 4 Apr 2009 11:08:48 +0000 (+0000) Subject: More updates to whatsnew X-Git-Tag: v3.1a2~34 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e7ec57dcfa37cefdc779f0666cacd6448edcad4d;p=python More updates to whatsnew --- diff --git a/Doc/whatsnew/3.1.rst b/Doc/whatsnew/3.1.rst index 2d3b20bf15..c4fcb34aad 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. .. ======================================================================