[Python-ideas] Intermediate Summary: Fast sum() for non-numbers

M.-A. Lemburg mal at egenix.com
Mon Jul 15 09:11:16 CEST 2013


I don't understand why people try to use sum() for anything
other than a sequence of numbers.

If you want to flatten a list, use a flatten function.

Here's a performance comparison of a few possible implementations:

http://stackoverflow.com/questions/406121/flattening-a-shallow-list-in-python

Pick one and you're fine :-)

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Jul 15 2013)
>>> Python Projects, Consulting and Support ...   http://www.egenix.com/
>>> mxODBC.Zope/Plone.Database.Adapter ...       http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________
2013-07-16: Python Meeting Duesseldorf ...                      tomorrow

::::: Try our mxODBC.Connect Python Database Interface for free ! ::::::

   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
    D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
           Registered at Amtsgericht Duesseldorf: HRB 46611
               http://www.egenix.com/company/contact/


More information about the Python-ideas mailing list