Alexander Belopolsky <belopol...@users.sourceforge.net> added the comment:

On Tue, Mar 10, 2009 at 5:15 PM, Tennessee Leeuwenburg
<rep...@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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue2706>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to