A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2019-February/156516.html below:

[Python-Dev] datetime.timedelta total_microseconds

[Python-Dev] datetime.timedelta total_microsecondsTerry Reedy tjreedy at udel.edu
Tue Feb 26 22:15:17 EST 2019
On 2/26/2019 7:03 PM, Chris Barker via Python-Dev wrote:

> So: it would be good to provide a correct, simple,  intuitive, and 
> discoverable way to do that.
> 
> timedelta.total_seconds()

To me, total_x implies that there is a summation of multiple timedeltas, 
and there is not.  So not intuitive to me.  (Neither us current obscure 
option).  It is also not obvious is answer is rounded to nearest second 
or not.

> 
> So at most, we could have:
> 
> .total_microseconds()
> .total_seconds()
> .total_minutes()
> .total_hours()
> .total_days()
> .total_weeks()

I am also not enthusiastic about multiple methods doing essentially the 
same thing.  I might prefer one method, .convert? with an argument 
specifying the conversion unit, 'microseconds', 'seconds', ... . I think 
this is in python-ideas territory.



-- 
Terry Jan Reedy


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4