[Patches] [ python-Patches-724936 ] new sum builtin
SourceForge.net
noreply@sourceforge.net
Mon, 21 Apr 2003 03:33:56 -0700
Patches item #724936, was opened at 2003-04-21 12:33
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=724936&group_id=5470
Category: Core (C code)
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Alex Martelli (aleax)
Assigned to: Nobody/Anonymous (nobody)
Summary: new sum builtin
Initial Comment:
as per discussion on Python-Dev. Note that
sum(manystrings), while still FAR faster than
reduce(operator.add, manystrings) and the equivalent loop,
is now about twice as slow as ''.join(manystrings) -- to
support the possibility that "manystrings" may be an
iterator, sum must retain the first item and
string-concatenate to it the ''.join of the others. I have not
mentioned this slight performance hit in the docs (just as
the far more severe performance trap with
reduce(operator.add, manystrings) is nowhere mentioned).
Also, I have not edited the tutorial. Please let me know if
you want more editing of such docs, I'll be quite glad to do
it, of course!
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=724936&group_id=5470