[issue18629] future division breaks timedelta division by integer

Antoine Pitrou report at bugs.python.org
Fri Aug 2 18:21:16 CEST 2013


Antoine Pitrou added the comment:

You're just looking for floor division:

$ python -Qnew
Python 2.7.4 (default, Apr 19 2013, 18:28:01) 
[GCC 4.7.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 1/2
0.5
>>> from datetime import timedelta
>>> print timedelta(seconds=3) // 2
0:00:01.500000

----------
nosy: +pitrou

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue18629>
_______________________________________


More information about the Python-bugs-list mailing list