Python day 1

18 November 2007 | Uncategorized | No Comments

It’s driving me nuts that something like this doesn’t work:


(Pdb) pp reduce(sum, [1,2])
*** TypeError: <exceptions.TypeError instance at 0xb7d4a76c>

If I could could do ‘+ I would.

Update:

OK I get it.


sum([1,3])

Duh.

Leave a Reply

You can follow the discussion through the Comments feed.