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, jribbens, vstinner, webograph
Date 2008-11-14.18:15:01
SpamBayes Score 1.9149923e-07
Marked as misclassified No
Message-id <1226686502.12.0.116749756505.issue2706@psf.upfronthosting.co.za>
In-reply-to
Content
Also, why not

>>> divmod(timedelta(3), 2)
(datetime.timedelta(1), datetime.timedelta(1))

?

And where do we stop? :-)

On Fri, Nov 14, 2008 at 1:02 PM, Alexander Belopolsky
<belopolsky@users.sourceforge.net> wrote:
> On Fri, Nov 14, 2008 at 12:51 PM, STINNER Victor 
<report@bugs.python.org> wrote:
>>
>> STINNER Victor <victor.stinner@haypocalc.com> added the comment:
>>
>> Why not also implementing divmod()? It's useful to split a timedelta
>> into, for example, (hours, minutes, seconds):
>
> I agree and in this case mod should probably be implemented too.
>
> With your patch:
>
>>>> timedelta(3)%timedelta(2)
> Traceback (most recent call last):
>  File "<stdin>", line 1, in <module>
> TypeError: unsupported operand type(s) for %: 'datetime.timedelta' and
> 'datetime.timedelta'
>
History
Date User Action Args
2008-11-14 18:15:02belopolskysetrecipients: + belopolsky, jribbens, amaury.forgeotdarc, vstinner, webograph
2008-11-14 18:15:02belopolskysetmessageid: <1226686502.12.0.116749756505.issue2706@psf.upfronthosting.co.za>
2008-11-14 18:15:01belopolskylinkissue2706 messages
2008-11-14 18:15:01belopolskycreate