Message254039
| Author |
abarry |
| Recipients |
abarry, kevinjqiu |
| Date |
2015年11月04日.04:34:26 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1446611667.03.0.404353938924.issue25549@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
`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. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2015年11月04日 04:34:27 | abarry | set | recipients:
+ abarry, kevinjqiu |
| 2015年11月04日 04:34:27 | abarry | set | messageid: <1446611667.03.0.404353938924.issue25549@psf.upfronthosting.co.za> |
| 2015年11月04日 04:34:27 | abarry | link | issue25549 messages |
| 2015年11月04日 04:34:26 | abarry | create |
|