This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author belopolsky
Recipients amaury.forgeotdarc, belopolsky, fredrikj, jribbens, mark.dickinson,, vstinner, webograph
Date 2009-03-11.03:33:40
SpamBayes Score 6.961152e-09
Marked as misclassified No
Message-id <>
In-reply-to <>
On Tue, Mar 10, 2009 at 5:15 PM, Tennessee Leeuwenburg
<> 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:47belopolskysetrecipients: + belopolsky, jribbens, amaury.forgeotdarc, mark.dickinson, vstinner, fredrikj, webograph,
2009-03-11 03:33:41belopolskylinkissue2706 messages
2009-03-11 03:33:40belopolskycreate