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