[issue13433] String format documentation contains error regarding %g

2011-11-26 Thread Christian Iversen
Christian Iversen c...@sikkerhed.org 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,

[issue13433] String format documentation contains error regarding %g

2011-11-25 Thread Terry J. Reedy
Terry J. Reedy tjre...@udel.edu 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

[issue13433] String format documentation contains error regarding %g

2011-11-21 Thread Christian Iversen
Christian Iversen c...@sikkerhed.org 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,

[issue13433] String format documentation contains error regarding %g

2011-11-20 Thread Éric Araujo
Éric Araujo mer...@netwok.org 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 Christian Iversen
New submission from Christian Iversen c...@sikkerhed.org: 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 %

[issue13433] String format documentation contains error regarding %g

2011-11-19 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com 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

[issue13433] String format documentation contains error regarding %g

2011-11-19 Thread Christian Iversen
Christian Iversen c...@sikkerhed.org 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

[issue13433] String format documentation contains error regarding %g

2011-11-19 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com 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

[issue13433] String format documentation contains error regarding %g

2011-11-19 Thread Eric V. Smith
Changes by Eric V. Smith e...@trueblade.com: -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13433 ___ ___ Python-bugs-list

[issue13433] String format documentation contains error regarding %g

2011-11-19 Thread Mark Dickinson
Changes by Mark Dickinson dicki...@gmail.com: -- versions: +Python 3.2, Python 3.3 -Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13433 ___