[docs] [issue18827] mistake in the timedelta.total_seconds docstring
Tim Peters
report at bugs.python.org
Sun Aug 25 00:14:29 CEST 2013
Tim Peters added the comment:
The docs look correct to me. For example,
>>> from datetime import *
>>> td = datetime.now() - datetime(1,1,1)
>>> td
datetime.timedelta(735103, 61756, 484000)
>>> td.total_seconds()
63512960956.484
^
What the docs say match that output:
>>> (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) / 1e6
63512960956.484
Your suggestion's output:
>>> (td.microseconds / 1e6 + (td.seconds + td.days * 24 * 3600) * 10**6)
6.3512960956e+16
You're multiplying the number seconds by a million - not a good idea ;-)
----------
nosy: +tim.peters
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue18827>
_______________________________________
More information about the docs
mailing list