Created
October 31, 2015 18:12
-
-
Save kevinjqiu/50bd98c2f0c35a750895 to your computer and use it in GitHub Desktop.
sum on timedelta
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> a=[datetime.timedelta(1), datetime.timedelta(2)] | |
>>> sum(a) | |
Traceback (most recent call last): | |
File "<stdin>", line 1, in <module> | |
TypeError: unsupported operand type(s) for +: 'int' and 'datetime.timedelta' | |
>>> a[0]+a[1] | |
datetime.timedelta(3) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment