> doesnt sum first construct the list then sum it?

> def com(lst):
>     return sum(x for x in lst)

You construct a generator over an existing list in your code.
Try sum([x for x in lst]) to see the effect of additional list
construction. And while you're at it, try the simple sum(lst).

Cheers,

- harold -
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to