Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 035272b

Browse files
committed
Add some more items
1 parent c11076e commit 035272b

1 file changed

Lines changed: 18 additions & 3 deletions

File tree

Doc/whatsnew/whatsnew23.tex

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,11 +1085,17 @@ \section{Other Language Changes}
10851085
\item Built-in types now support the extended slicing syntax,
10861086
as described in section~\ref{section-slices} of this document.
10871087

1088+
\item A new built-in function, \function{sum(\var{iterable}, \var{start}=0)},
1089+
adds up the numeric items in the iterable object and returns their sum.
1090+
\function{sum()} only accepts numbers, meaning that you can't use it
1091+
to concatenate a bunch of strings, for example. (Contributed by Alex
1092+
Martelli.)
1093+
10881094
\item Dictionaries have a new method, \method{pop(\var{key}\optional{,
10891095
\var{default}})}, that returns the value corresponding to \var{key}
10901096
and removes that key/value pair from the dictionary. If the requested
1091-
key isn't present in the dictionary, \var{default} is returned if
1092-
it's specified and \exception{KeyError} raised if it isn't.
1097+
key isn't present in the dictionary, \var{default} is returned if it's
1098+
specified and \exception{KeyError} raised if it isn't.
10931099

10941100
\begin{verbatim}
10951101
>>> d = {1:2}
@@ -1397,6 +1403,9 @@ \section{New, Improved, and Deprecated Modules}
13971403
them to override the settings in Python's configuration (contributed
13981404
by Robert Weber).
13991405

1406+
\item The new \function{gc.get_referents(\var{object})} function returns a
1407+
list of all the objects referenced by \var{object}.
1408+
14001409
\item The \module{getopt} module gained a new function,
14011410
\function{gnu_getopt()}, that supports the same arguments as the existing
14021411
\function{getopt()} function but uses GNU-style scanning mode.
@@ -1524,6 +1533,12 @@ \section{New, Improved, and Deprecated Modules}
15241533
tidied and brought up to date in various ways. (Contributed by Greg
15251534
Ward and Nicholas FitzRoy-Dale.)
15261535

1536+
\item The new \module{platform} module contains a number of functions
1537+
that try to determine various properties of the platform you're
1538+
running on. There are functions for getting the architecture, CPU
1539+
type, the Windows OS version, and even the Linux distribution version.
1540+
(Contributed by Marc-Andr\'e Lemburg.)
1541+
15271542
\item The parser objects provided by the \module{pyexpat} module
15281543
can now optionally buffer character data, resulting in fewer calls to
15291544
your character data handler and therefore faster performance. Setting
@@ -1576,7 +1591,7 @@ \section{New, Improved, and Deprecated Modules}
15761591

15771592
(Sticking with Python 2.2 or 2.1 will not make your applications any
15781593
safer because there are known bugs in the \module{rexec} module in
1579-
those versions. I repeat, if you're using \module{rexec}, stop using
1594+
those versions. To repeat: if you're using \module{rexec}, stop using
15801595
it immediately.)
15811596

15821597
\item The \module{rotor} module has been deprecated because the

0 commit comments

Comments
 (0)