[Python-Dev] datetime.timedelta total_microseconds
rbellevi at google.com
Thu Feb 14 00:05:54 EST 2019
In a recent code review, the following snippet was called out as
_MICROSECONDS_PER_SECOND = 1000000
return int(delta.total_seconds() * _MICROSECONDS_PER_SECOND)
The reviewer thought that there must already exist a standard library
that fulfills this functionality. After we had both satisfied ourselves
hadn't simply missed something in the documentation, we decided that we had
better raise the issue with a wider audience.
Does this functionality already exist within the standard library? If not,
a datetime.timedelta.total_microseconds function be a reasonable addition? I
would be happy to submit a patch for such a thing.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-Dev