Re: [Python-Dev] datetime.timedelta total_microseconds

2019-02-27 Thread Richard Belleville via Python-Dev
gt; > The OP: > """ > On Wed, Feb 13, 2019 at 9:10 PM Richard Belleville via Python-Dev < > python-dev@python.org> wrote: > >> In a recent code review, the following snippet was called out as >> reinventing the >> wheel: >> >>

[Python-Dev] datetime.timedelta total_microseconds

2019-02-13 Thread Richard Belleville via Python-Dev
In a recent code review, the following snippet was called out as reinventing the wheel: _MICROSECONDS_PER_SECOND = 100 def _timedelta_to_microseconds(delta): return int(delta.total_seconds() * _MICROSECONDS_PER_SECOND) The reviewer thought that there must already exist a standard library