simpler increment of time values?

Steven D'Aprano steve+comp.lang.python at pearwood.info
Fri Jul 6 04:34:25 CEST 2012


On Thu, 05 Jul 2012 11:15:04 -0700, rurpy wrote:

> On Thursday, July 5, 2012 11:34:16 AM UTC-6, John Nagle wrote:
>>[...]
>>    You can also call time.time(), and get the number of seconds
>> since the epoch (usually 1970-01-01 00:00:00 UTC). That's just a
>> number, and you can do arithmetic on that.
>> 
>>    Adding a datetime.time to a datetime.timedelta isn't that
>> useful.
> 
> It certainly is useful and I gave an obvious and real- world example in
> my previous post.

Agreed.

A timedelta of less than one day magnitude should be usable with time 
objects, and wrap around at midnight. That's a clear and useful extension 
to the current functionality.

I can't see a feature request (rejected or otherwise) on the bug tracker. 
Perhaps you should raise one for Python 3.4. It will have a better chance 
of being accepted if you include a patch, or at least tests.

http://bugs.python.org/



-- 
Steven



More information about the Python-list mailing list