reduce to be removed?

Dustan DustanGroups at
Sat Nov 11 23:50:43 CET 2006

Fredrik Lundh wrote:
> Dustan wrote:
> > What's an accumulation loop, and how would I convert this code so it's
> > compatible with the future 3.0
> the release of Python 3.0 is far away, and nobody knows how it's going
> to look.  trying to be future-compatible at this time is a major waste
> of time and (not quite as wasteful as reopening yet another old "let's
> make some pointless change to the language" thread, but almost).
> surely you must have something better to do with your time ?
> </F>

It's always nice to know there are such good-natured people ready to
help on this group. Anyway, I figured out a way to get the builtin
function 'sum' to work as I need:
sum([[1,2,3],[4,5,6],[7,8,9]],  [])

On an unrelated note, can anyone explain this unpredictable behavior on
IDLE? I swear I never hit ctrl-c...
>>> help(sum)
Help on built-in function sum in module __builtin__:

    sum(sequence, start=0) -> value

    Returns the sum of a sequence of numbers (NOT strings) plus the
    of parameter 'start'.  When the sequence is empty, returns start.
Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
  File "C:\Python25\lib\", line 346, in __call__
    return*args, **kwds)
  File "C:\Python25\lib\", line 1642, in __call__
  File "C:\Python25\lib\", line 1687, in help
  File "C:\Python25\lib\idlelib\", line 1246, in write, self.tags)
  File "C:\Python25\lib\idlelib\", line 1235, in write
    raise KeyboardInterrupt

More information about the Python-list mailing list