> > > However I find the seccond argument hack ugly. Does the sum way have any > > > performance advantages over the reduce way? > > > Yes, sum() is faster: ...
> Not really; you measure the import and the attribute access time in > the second case. sum() is 2x faster for adding numbers only: Try it with Py2.6 or Py3.0. The sum() function has been optimized and should be at least 6x faster for summing ints and floats. It should even beat psyco optimized sums! Raymond -- http://mail.python.org/mailman/listinfo/python-list