Hi all,<br><br>I&#39;m just trying to find my feet with regards to the proper process for reviewing. I&#39;m not sure what&#39;s best:<br>  * Post the review as a comment on the associated issue. Only nosies will be updated.<br>

  * Post the review as a comment on the issue, then post a one-line information update to this list<br>  * Post the review to this list for consideration<br>  * ???? other<br><br><a href="http://bugs.python.org/issue2706" target="_blank">http://bugs.python.org/issue2706</a><br>

General topic: Math operations on timedelta objects<br>Last activity: 12 Dec 08<br>Original owner: webograph<br><br>This issue covers a number of discrete functional changes. I here review each in turn:<br><br>1) Allow truediv, the operator &#39;/&#39;, to be applied to two timedeltas (e.g. td1 / td2). The return value is a float representing the number of times that td2 goes into td1.<br>


<br>Evaluation: Since both time deltas are quantitative values of the same unit, it makes sense they should be able to support basic math operations. In this case, operation to be added is &#39;/&#39; or truediv. I would personally find this functionality useful, and believe it is a natural addition to the code.<br>


<br>Recommendation: That this functionality be recommended for development<br><br>2) Allow truediv to be applied to a timedelta and an int or float. The return value is a timedelta representing the fractional proportion of the original timedelta.<br>


<br>Evaluation: This makes total sense.<br>Recommendation: That this functionality be recommended for development<br><br>2) Allow divmod, the operator &#39;%&#39;, 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.<br>


<br>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.<br>

<br>3) Allow divmod, the operator &#39;%&#39;, to be applied to a timedelta and an integer or float. (e.g. &lt;timedelta&gt; % 3). I&#39;m not quite as sold on this.  I suggest that more discussion is required to flesh this out further.<br>
<br><br>A patch has been attached which implements some of this behaviour. I would suggest that it&#39;s valuable to start doing this work in discrete chunks so that progress can be begun before the issues under debate are resolved. I suggest that it would be appropriate to create three smaller issues, each tackling just one piece of functionality. This should make the changes more atomic and the code patch simpler.<br>

<br>-T<br clear="all"><br>-- <br>--------------------------------------------------<br>Tennessee Leeuwenburg<br><a href="http://myownhat.blogspot.com/" target="_blank">http://myownhat.blogspot.com/</a><br>
&quot;Don&#39;t believe everything you think&quot;<br>