[issue8644] timedelta.total_seconds needlessly inaccurate, especially for negative timedeltas

Alexander Belopolsky report at bugs.python.org
Fri May 7 18:36:04 CEST 2010


Alexander Belopolsky <belopolsky at users.sourceforge.net> added the comment:

I am attaching a patch for py3k branch.  I am +1 for backporting to 2.7 and I avoided relying on py3k timedelta/timedelta in the patch.  The tests  and docs will need to be modified for the backport.

Technically speaking, this is a change in documented behavior for 2.7 because according to current docs, td.total_seconds() is equivalent to ``td.microseconds / 1000000 + td.seconds + td.days * 24 * 3600``.  Therefore I would appreciate if reviewer made a decision on backport.

----------
keywords: +patch
stage: needs patch -> patch review
Added file: http://bugs.python.org/file17246/issue8644-py3k.diff

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8644>
_______________________________________


More information about the Python-bugs-list mailing list