Mark Dickinson dicki...@gmail.com added the comment:
Perfect! Applied in r81020.
You're correct that n/10**6 and n/1e6 aren't the same thing, at least for n
large enough:
Python 2.7b2+ (trunk:81019:81020, May 9 2010, 10:33:17)
[GCC 4.2.1 (Apple Inc. build 5659)] on darwin
Type help,
Mark Dickinson dicki...@gmail.com added the comment:
Looks good to me.
I definitely think this should go into 2.7 as well; total_seconds has only
seen the light of day in the beta releases so far, so it's unlikely we'd break
anyone's code with this change. (And IMO this is a bugfix, not a
Mark Dickinson dicki...@gmail.com added the comment:
If you want a second (third?) opinion, we could ask Antoine.
--
nosy: +pitrou
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8644
___
Mark Dickinson dicki...@gmail.com added the comment:
[Antoine declines to offer an opinion.]
Committed to py3k in r80979. I moved the Misc/NEWS entry from the 'Library'
section to the 'Extension Modules' section.
Leaving open for the 2.7 backport.
--
Changes by Mark Dickinson dicki...@gmail.com:
--
resolution: - accepted
versions: -Python 3.2
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8644
___
Alexander Belopolsky belopol...@users.sourceforge.net added the comment:
On Sat, May 8, 2010 at 10:07 AM, Mark Dickinson rep...@bugs.python.org wrote:
..
I definitely think this should go into 2.7 as well; Â total_seconds has only
seen the light of day
in the beta releases so far, so it's
Changes by Alexander Belopolsky belopol...@users.sourceforge.net:
Removed file: http://bugs.python.org/file17266/issue8644.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8644
___
New submission from Mark Dickinson dicki...@gmail.com:
I just noticed (while responding to issue 8643) that timedelta.total_seconds()
has some accuracy problems, especially for negative timedeltas:
Python 3.2a0 (py3k:80840:80842, May 7 2010, 12:29:35)
[GCC 4.2.1 (Apple Inc. build 5659)] on
Mark Dickinson dicki...@gmail.com added the comment:
P.S. This change would also make total_seconds() consistent with division by
timedelta(seconds=1):
td / timedelta(seconds=1)
-0.000123
In fact, this might even be a good way to re-implement total_seconds internally.
--
Alexander Belopolsky belopol...@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
Mark Dickinson dicki...@gmail.com added the comment:
Thanks for the patch! Comments, in increasing order of fussiness:
(1) there should be a Py_DECREF(total_microseconds) in the case that the
PyLong_FromLong(100L) call fails
(2) in the docstring, replace 'loose' by 'lose'
(3) also in
Mark Dickinson dicki...@gmail.com added the comment:
Grr. s/docstring/docs/
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8644
___
___
Alexander Belopolsky belopol...@users.sourceforge.net added the comment:
(1) there should be a Py_DECREF(total_microseconds) ...
Yes, regrtest -R is not a substitute for thinking.
(2) in the docstring, replace 'loose' by 'lose'
Neither is spellcheck. :-)
(3) also in the docstring, I
Changes by Alexander Belopolsky belopol...@users.sourceforge.net:
Removed file: http://bugs.python.org/file17246/issue8644-py3k.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8644
___
Changes by Alexander Belopolsky belopol...@users.sourceforge.net:
Added file: http://bugs.python.org/file17255/issue8644-py3k.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8644
___
Changes by Alexander Belopolsky belopol...@users.sourceforge.net:
Removed file: http://bugs.python.org/file17254/issue8644-py3k.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8644
___
16 matches
Mail list logo