Message83453
On Tue, Mar 10, 2009 at 5:15 PM, Tennessee Leeuwenburg
<report@bugs.python.org> wrote:
..
> 2) Allow divmod, the operator '%', to be applied to two timedeltas (e.g.
> td1 % td2). I think there is some debate here about whether the return
> value be an integer in microsends, or a timedelta. I personally believe
> that a timedelta should be returned, representing the amount of time
> remaining after (td1 // td2) * td2 has been subtracted.
>
> The alternative is an integer, but due to a lack of immediate clarity
> over what time quanta this integer represents, I would suggest returning
> a unit amount. There is also some discussion of returning (long,
> timedelta), but I personally fail to see the merits of returning the
> long without some unit attached.
>
I don't think this alternative was ever seriously considered and no
patch was ever proposed to do it that way. Victor's latest patch
implements divmod(timedelta, timedelta) -> (int, timedelta) and
therefore timedelta % timedelta -> timedelta. |
|
Date |
User |
Action |
Args |
2009-03-11 03:33:47 | belopolsky | set | recipients:
+ belopolsky, jribbens, amaury.forgeotdarc, mark.dickinson, vstinner, fredrikj, webograph, tleeuwenburg@gmail.com |
2009-03-11 03:33:41 | belopolsky | link | issue2706 messages |
2009-03-11 03:33:40 | belopolsky | create | |
|