[issue7117] Backport py3k float repr to trunk

2011-06-30 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: I've filed issue12450 to track this last idea. -- nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7117 ___

[issue7117] Backport py3k float repr to trunk

2011-06-30 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@haypocalc.com: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7117 ___ ___

[issue7117] Backport py3k float repr to trunk

2011-06-29 Thread Michael Foord
Michael Foord mich...@voidspace.org.uk added the comment: Wondered if you guys had heard of some recent advances in the state of the art in this field. I'm sure you have, but thought I'd link it here anywhere. Quote taken from this article (which links to relevant papers):

[issue7117] Backport py3k float repr to trunk

2011-06-29 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Hadn't seen that. Interesting! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7117 ___ ___

[issue7117] Backport py3k float repr to trunk

2011-06-29 Thread Raymond Hettinger
Raymond Hettinger raymond.hettin...@gmail.com added the comment: Thanks for the link :-) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7117 ___

[issue7117] Backport py3k float repr to trunk

2009-11-25 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Thanks, Eric. The only remaining documentation issues I'm aware of are in Doc/tutorial/floatingpoint.rst. I think Raymond is going to update this to match the py3k version. I'll call this done, then! Thanks for all your help. --

[issue7117] Backport py3k float repr to trunk

2009-11-24 Thread Eric Smith
Eric Smith e...@trueblade.com added the comment: Thanks for tackling the last few bits, Mark. I think we're done, although I admit I haven't verified what state the documentation is in. I suggest we close this issue and if any problems occur open them as new issues. --

[issue7117] Backport py3k float repr to trunk

2009-11-23 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: r76465 removes the fixed-length buffer for formatting floats, hence removes the restriction on the precision. This should make removal of the %f - %g switch straightforward. -- ___ Python

[issue7117] Backport py3k float repr to trunk

2009-11-23 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: r76474: Remove %f - %g switch. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7117 ___ ___

[issue7117] Backport py3k float repr to trunk

2009-11-19 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Short float repr is now enabled in r76379. Misc/NEWS entries added/updated in r76411. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7117

[issue7117] Backport py3k float repr to trunk

2009-11-18 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: r76373: Backport round. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7117 ___ ___

[issue7117] Backport py3k float repr to trunk

2009-11-03 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Here's a patch for correctly-rounded round in trunk. This patch doesn't change the rounding behaviour between 2.6 and 2.7: it's still doing round-half-away-from-zero instead of round-half-even. It was necessary to detect and treat

[issue7117] Backport py3k float repr to trunk

2009-10-31 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: r75979: Deprecate PyOS_ascii_atof and PyOS_ascii_strtod; document PyOS_double_to_string. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7117

[issue7117] Backport py3k float repr to trunk

2009-10-29 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: The next job is to deprecate PyOS_ascii_atof and PyOS_ascii_strtod, I think. I'll get to work on that. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7117

[issue7117] Backport py3k float repr to trunk

2009-10-28 Thread Eric Smith
Eric Smith e...@trueblade.com added the comment: r75913: Fix _json.c to use PyOS_string_to_double. Change made after consulting with Bob Ippolito. This completes the removal of calls to PyOS_ascii_strtod. -- ___ Python tracker rep...@bugs.python.org

[issue7117] Backport py3k float repr to trunk

2009-10-27 Thread Eric Smith
Eric Smith e...@trueblade.com added the comment: r75743: Fix cPickle.c to use PyOS_string_to_double. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7117 ___

[issue7117] Backport py3k float repr to trunk

2009-10-27 Thread Eric Smith
Eric Smith e...@trueblade.com added the comment: r75745: Fix stropmodule.c to use PyOS_string_to_double. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7117 ___

[issue7117] Backport py3k float repr to trunk

2009-10-27 Thread Eric Smith
Eric Smith e...@trueblade.com added the comment: r75824: Fix ast.c to use PyOS_string_to_double. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7117 ___

[issue7117] Backport py3k float repr to trunk

2009-10-27 Thread Eric Smith
Eric Smith e...@trueblade.com added the comment: r75846: Fix marshal.c to use PyOS_string_to_double. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7117 ___

[issue7117] Backport py3k float repr to trunk

2009-10-26 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: r75720: Backport py3k version of pystrtod.c to trunk. There are still some (necessary) differences between the two versions, which should become unnecessary once everything else is hooked up. The differences should be

[issue7117] Backport py3k float repr to trunk

2009-10-26 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: [Eric, on removing f to g conversions] Should we also do that as part of this exercise? Or should it be another issue, or not done at all? I'd definitely like to remove the f to g conversion in trunk. I don't see any great need to open a

[issue7117] Backport py3k float repr to trunk

2009-10-26 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Found it: issue #5859 was opened for the removal of the f - g conversion in py3k. We could just add a note to that issue. -- ___ Python tracker rep...@bugs.python.org

[issue7117] Backport py3k float repr to trunk

2009-10-26 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: r75730: backport pystrtod.h r75731: Fix floatobject.c to use PyOS_string_to_double. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7117

[issue7117] Backport py3k float repr to trunk

2009-10-26 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: r75739: Fix complexobject.c to use PyOS_string_to_double. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7117 ___

[issue7117] Backport py3k float repr to trunk

2009-10-24 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Some key revision numbers from the py3k short float repr, for reference: r71663: include Gay's code, build and configure fixes r71723: backout SSE2 detection code added in r71663 r71665: rewrite of float formatting code to use Gay's code

[issue7117] Backport py3k float repr to trunk

2009-10-24 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: r75666: Add sys.float_repr_style attribute. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7117 ___

[issue7117] Backport py3k float repr to trunk

2009-10-24 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: r75672: temporarily disable the short float repr while we're putting the pieces in place. When testing, the disablement can be disabled (hah) by defining the PY_SHORT_FLOAT_REPR preprocessor symbol, e.g. (on Unix) with CC='gcc

[issue7117] Backport py3k float repr to trunk

2009-10-24 Thread Eric Smith
Eric Smith e...@trueblade.com added the comment: I think the next step on my side is to remove _PyOS_double_to_string, and make all of the internal code call PyOS_double_to_string. The distinction is that _PyOS_double_to_string gets passed a buffer and length, but PyOS_double_to_string returns

[issue7117] Backport py3k float repr to trunk

2009-10-24 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: One issue occurs to me: should the backport change the behaviour of the round function? In py3k, round consistently uses round-half-to-even for halfway cases. In trunk, round semi-consistently uses round-half-away-from-zero (and this is

[issue7117] Backport py3k float repr to trunk

2009-10-24 Thread Eric Smith
Eric Smith e...@trueblade.com added the comment: Adding tim_one as nosy. He'll no doubt have an opinion on rounding. And hopefully he'll share it! -- nosy: +tim_one ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7117

[issue7117] Backport py3k float repr to trunk

2009-10-24 Thread Eric Smith
Eric Smith e...@trueblade.com added the comment: Another thing to consider is that in py3k we removed all conversions of converting 'f' to 'g', such as this, from Objects/unicodeobject.c: if (type == 'f' fabs(x) = 1e50) type = 'g'; Should we also do that as part of this exercise?

[issue7117] Backport py3k float repr to trunk

2009-10-24 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: +1 on backporting the 'f' and 'g' work also. We will be well served by getting the two code bases ins-sync with one another. Eliminating obscure differences makes it easier to port code from 2.x to 3.x --

[issue7117] Backport py3k float repr to trunk

2009-10-13 Thread Mark Dickinson
New submission from Mark Dickinson dicki...@gmail.com: See the thread starting at: http://mail.python.org/pipermail/python-dev/2009-October/092958.html Eric suggested that we don't need a separate branch for this; sounds fine to me. It should still be possible to do the backport in stages,