From 3da1186cdd735296b84e77f5c6889d3958266bc8 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Tue, 15 Mar 2005 04:06:02 +0000 Subject: [PATCH] sum()'s second argument is returned if the first argument is empty, otherwise it is ignored. --- pep-3000.txt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pep-3000.txt b/pep-3000.txt index afe5c2a9e..181b4e267 100644 --- a/pep-3000.txt +++ b/pep-3000.txt @@ -90,14 +90,15 @@ Built-ins * Introduce ``trunc()``, which would call the ``__trunc__()`` method on its argument; suggested use if for objects like float where calling ``__int__()`` has data loss, but an integral representation is still desired [8]_ +* The second argument to ``sum()`` will returned if the first argument is + empty, otherwise it is ignored [10]_ To be removed: * ``apply()``: use ``f(*args, **kw)`` instead [2]_ * ``buffer()``: must die (use a bytes() type instead) [2]_ * ``callable()``: just call the object and catch the exception [2]_ -* ``compile()``: put in ``sys`` (or perhaps in a module of its own) - [2]_ +* ``compile()``: put in ``sys`` (or perhaps in a module of its own) [2]_ * ``coerce()``: no longer needed [2]_ * ``execfile()``, ``reload()``: use ``exec()`` [2]_ * ``input()``: use ``eval(sys.stdin.readline())`` [2]_ @@ -143,13 +144,16 @@ References .. [7] python-dev email ("Let's get rid of unbound methods") http://mail.python.org/pipermail/python-dev/2005-January/050625.html -.. [8] python-dev email( "Fixing _PyEval_SliceIndex so that integer-like +.. [8] python-dev email ("Fixing _PyEval_SliceIndex so that integer-like objects can be used") http://mail.python.org/pipermail/python-dev/2005-February/051674.html .. [9] Guido's blog ("The fate of reduce() in Python 3000") http://www.artima.com/weblogs/viewpost.jsp?thread=98196 +.. [10] python-dev email ("Rationale for sum()'s design?") + http://mail.python.org/pipermail/python-dev/2005-March/052183.html + Copyright =========