[issue5864] format(1234.5, '.4') gives misleading result

2009-07-07 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: I'm not going to backport this to 2.6. The problem is that the fix for this issue is tied up with the corresponding change to str (str(1e11) produces '1e+11' in trunk and 1000.0 in release26-maint); I daren't change str() in 2.6,

[issue5864] format(1234.5, '.4') gives misleading result

2009-07-07 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: ... and 3.0 is dead. -- versions: -Python 3.0 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5864 ___

[issue5864] format(1234.5, '.4') gives misleading result

2009-07-07 Thread Eric Smith
Eric Smith e...@trueblade.com added the comment: I agree that backporting it to 2.6 would be nice, but it would be a huge change. There's too much risk involved. So this will just be a new feature in 2.7. It's already in Misc/NEWS, so you're all set there. I'm closing the issue, marking it as

[issue5864] format(1234.5, '.4') gives misleading result

2009-05-16 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Eric, any thoughts on whether this should be backported to 2.6 and 3.0? It looks like quite a lot of work. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5864

[issue5864] format(1234.5, '.4') gives misleading result

2009-05-16 Thread Mark Dickinson
Changes by Mark Dickinson dicki...@gmail.com: -- priority: - normal versions: +Python 2.6, Python 3.0 -Python 2.7, Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5864 ___

[issue5864] format(1234.5, '.4') gives misleading result

2009-05-16 Thread Eric Smith
Eric Smith e...@trueblade.com added the comment: I don't see any point in backporting to 3.0 at this point. While it's definitely a problem in 2.6, it seems like a big change to make in a bugfix release. I guess I'm +0 on it. -- ___ Python tracker

[issue5864] format(1234.5, '.4') gives misleading result

2009-04-29 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: I'm working on a patch. The fix for the new-style PyOS_double_to_string using Gay's dtoa is a one-liner. The fix for the fallback code is going to take a little while longer... -- assignee: - marketdickinson

[issue5864] format(1234.5, '.4') gives misleading result

2009-04-29 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Here's a patch for py3k; backporting to trunk should be straightforward. Backporting to 2.6 may involve more work. -- keywords: +patch Added file: http://bugs.python.org/file13813/issue5864.patch

[issue5864] format(1234.5, '.4') gives misleading result

2009-04-29 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Updated patch; the previous patch messed str() up. -- Added file: http://bugs.python.org/file13814/issue5864.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5864

[issue5864] format(1234.5, '.4') gives misleading result

2009-04-29 Thread Mark Dickinson
Changes by Mark Dickinson dicki...@gmail.com: Removed file: http://bugs.python.org/file13813/issue5864.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5864 ___

[issue5864] format(1234.5, '.4') gives misleading result

2009-04-29 Thread Mark Dickinson
Changes by Mark Dickinson dicki...@gmail.com: -- stage: needs patch - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5864 ___ ___

[issue5864] format(1234.5, '.4') gives misleading result

2009-04-29 Thread Eric Smith
Eric Smith e...@trueblade.com added the comment: I'm getting an undefined _remove_trailing_zeros using a normal build (not using the fallback code). I think it's now always called. -- stage: patch review - needs patch ___ Python tracker

[issue5864] format(1234.5, '.4') gives misleading result

2009-04-29 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: I think it's now always called. I think you're right. I've moved remove_trailing_zeros further up, out of the #ifdef PY_NO_SHORT_FLOAT_REPR. -- Added file: http://bugs.python.org/file13816/issue5864_v2.patch

[issue5864] format(1234.5, '.4') gives misleading result

2009-04-29 Thread Eric Smith
Eric Smith e...@trueblade.com added the comment: Using the _v2 patch, I tested both with the fallback code and with Gay's code, and both work. It's sort of shocking just how much effort you had to go through! But I can't see a simpler way to do it. It looks good to me. -- stage: needs

[issue5864] format(1234.5, '.4') gives misleading result

2009-04-29 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Thanks, Eric. Applied to py3k in r72109. I've blocked it from release30- maint for now, since it will almost certainly not be possible to svnmerge it cleanly, but that doesn't preclude backporting it at some stage. I'll backport to trunk

[issue5864] format(1234.5, '.4') gives misleading result

2009-04-29 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Backported to trunk in r72119. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5864 ___ ___

[issue5864] format(1234.5, '.4') gives misleading result

2009-04-28 Thread Mark Dickinson
New submission from Mark Dickinson dicki...@gmail.com: In all versions of Python from 2.6 up, I get the following behaviour: format(123.456, '.4') '123.5' format(1234.56, '.4') '1235.0' format(12345.6, '.4') '1.235e+04' The first and third results are as I expect, but the second is somewhat

[issue5864] format(1234.5, '.4') gives misleading result

2009-04-28 Thread Eric Smith
Eric Smith e...@trueblade.com added the comment: I agree this should be changed. This: format(1234.56, '.4') '1235.0' is definitely a problem. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5864

[issue5864] format(1234.5, '.4') gives misleading result

2009-04-28 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: I think the change should be deemed a bug and backported. Nothing good can come from having version differences persist or from having the odd looking output. -- nosy: +rhettinger