[issue4291] Allow Division of datetime.timedelta Objects

Mark Dickinson report at bugs.python.org
Sat Nov 15 11:47:24 CET 2008


Mark Dickinson <dickinsm at gmail.com> added the comment:

[Christian]
> float(td1) / float(td2) which is far more obvious than td1 / td2

To me, td1/td2 is more obvious that float(td1)/float(td2).

float(td) involves an arbitrary choice, to return time in *seconds* 
(rather than days, or milliseconds, or ...);  I think this violates 
EIBTI.  To me, the obvious and easy-to-read way to get the number
of seconds is to do the division:

seconds_in_td = td1 / timedelta(seconds = 1)

----------
nosy: +marketdickinson

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


More information about the Python-bugs-list mailing list