Message254038
| Author |
kevinjqiu |
| Recipients |
kevinjqiu |
| Date |
2015年11月04日.04:11:46 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1446610306.98.0.69863764968.issue25549@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Calling sum() on a list of timedelta objects results in TypeError: unsupported operand type(s) for +: 'int' and 'datetime.timedelta'
Here's a script that illustrates this behaviour: (also attached)
import datetime
x = [datetime.timedelta(1), datetime.timedelta(2)]
print(x[0] + x[1]) # datetime.timedelta(3)
print(sum(x)) # TypeError: unsupported operand type(s) for +: 'int' and 'datetime.timedelta'
The bug is present in all version of Python 2 and Python 3 |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2015年11月04日 04:11:47 | kevinjqiu | set | recipients:
+ kevinjqiu |
| 2015年11月04日 04:11:46 | kevinjqiu | set | messageid: <1446610306.98.0.69863764968.issue25549@psf.upfronthosting.co.za> |
| 2015年11月04日 04:11:46 | kevinjqiu | link | issue25549 messages |
| 2015年11月04日 04:11:46 | kevinjqiu | create |
|