[issue13433] String format documentation contains error regarding %g

2011-11-26 Thread Christian Iversen
Christian Iversen added the comment: Terry, the %g format always trims trailing zeroes, so you'd have to try with a number that doesn't end in zero. I had to make a re-implementation of format for javascript: http://paste.pocoo.org/show/513078/ If you look at the %g case, you can clearly see

[issue13433] String format documentation contains error regarding %g

2011-11-25 Thread Terry J. Reedy
Terry J. Reedy added the comment: I find the doc for g/G less than clear. 1. (main entry) "Uses lowercase exponential format if exponent is less than -4 or not less than precision, decimal format otherwise." 'not less' means 'equal or greater', which to me is clearer. Even better and clearer

[issue13433] String format documentation contains error regarding %g

2011-11-21 Thread Christian Iversen
Christian Iversen added the comment: Certainly, I don't think we should be peppering the docs with warnings and notes, either. However, the elements in question _already have_ notes. I propose that the note for %g (4) simply be updated for clarity. Something like this, perhaps: """Unlike the

[issue13433] String format documentation contains error regarding %g

2011-11-20 Thread Éric Araujo
Éric Araujo added the comment: I agree with Mark. The Documenting Python docs were recently updated by Raymond Hettinger to recommend not abusing notes and warnings, and the doc maintainer Georg Brandl approved it: d5d91b14b238 (#12047). -- nosy: +eric.araujo ___

[issue13433] String format documentation contains error regarding %g

2011-11-19 Thread Mark Dickinson
Changes by Mark Dickinson : -- versions: +Python 3.2, Python 3.3 -Python 2.6 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue13433] String format documentation contains error regarding %g

2011-11-19 Thread Eric V. Smith
Changes by Eric V. Smith : -- nosy: +eric.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyt

[issue13433] String format documentation contains error regarding %g

2011-11-19 Thread Mark Dickinson
Mark Dickinson added the comment: > Maybe a note describing that %g is different from the others in this regard? -1 from me; I don't really see that that would improve the documentation. Maybe that's just me, but I expect reference documentation to be clean, and uncluttered with too many wa

[issue13433] String format documentation contains error regarding %g

2011-11-19 Thread Christian Iversen
Christian Iversen added the comment: That was exactly the page I was looking at, and after some discussion on #python, I can see how they differ. Perhaps this could be clarified in the documentation? It's very easy to miss as it is now. Maybe a note describing that %g is different from the ot

[issue13433] String format documentation contains error regarding %g

2011-11-19 Thread Mark Dickinson
Mark Dickinson added the comment: Yep, there's an oddity here that's directly inherited from C's sprintf family of functions, namely that in %e-style formatting you give the number of digits after the point (= one less than the total number of significant digits), and in %g-style formatting y

[issue13433] String format documentation contains error regarding %g

2011-11-19 Thread Christian Iversen
New submission from Christian Iversen : The documentation for string format options state that both %f, %g and %e default to 6 digits after the decimal point. In fact, %g always seems to use 5 digits by default: >>> "%g" % 2.1234567 '2.12346' >>> "%f" % 2.1234567 '2.123457' >>> "%e" % 2.123456