a few extensions for the itertools

Fredrik Lundh fredrik at pythonware.com
Mon Nov 20 03:57:36 EST 2006


Mathias Panzenboeck wrote:

> No, because the builtin sum want's a list.

the one in Python doesn't:

 >>> def g():
...     for i in range(3):
...         print "yield", i
...         yield i
...
 >>> sum(g())
yield 0
yield 1
yield 2
3

</F>




More information about the Python-list mailing list