Emanuel Barry added the comment:

`sum` has an optional `start` parameter, which defaults to 0, and is used as 
the first item to add. Since timedeltas and ints are not interoperable, that 
means you have to explicitly tell sum what to use.

The following code works:

>>> e=[datetime.timedelta(3), datetime.timedelta(5)]
>>> sum(e, datetime.timedelta(0))
datetime.timedelta(8)

This is not a bug, but maybe this could use a more descriptive error message? I 
don't know.

----------
nosy: +ebarry

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25549>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to