[issue21195] None float format: incomplete documentation

2020-12-01 Thread Irit Katriel
Irit Katriel added the comment: Python 2.7-only issue. -- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed ___ Python tracker ___

[issue21195] None float format: incomplete documentation

2014-04-10 Thread Eric O. LEBIGOT
Eric O. LEBIGOT added the comment: The Python 2.7 goes even as far as to say that format(1e10, ' ') should give "the same as" format(1e10, ' g') (not something "similar to g"), which is obviously incorrect. If the Python 3.4 documentation for the empty presentation type of floats were used in

[issue21195] None float format: incomplete documentation

2014-04-10 Thread Eric V. Smith
Eric V. Smith added the comment: The rule is: - if the entire format specifier is the empty string (not None, but ''), then return str(value) - else, look at the presentation type. if it is missing, set it to something like 'g' - do the normal float formatting using the presentation type The f

[issue21195] None float format: incomplete documentation

2014-04-10 Thread Mark Dickinson
Changes by Mark Dickinson : -- nosy: +mark.dickinson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue21195] None float format: incomplete documentation

2014-04-10 Thread Eric O. LEBIGOT
Eric O. LEBIGOT added the comment: These examples are good. I am confused, though, about "The SO question is asking about an empty "presentation type", which is indeed similar to 'g' for floats.": the question is actually about why the '' format gives a result that differs from the 'g' format

[issue21195] None float format: incomplete documentation

2014-04-10 Thread Eric V. Smith
Eric V. Smith added the comment: An empty format specifier can (and to my knowledge, does) match str(). So you get: >>> format(1e10, '') '100.0' >>> format(1e10, 'g') '1e+10' >>> str(1e10) '100.0' The SO question is asking about an empty "presentation type", which is indeed si

[issue21195] None float format: incomplete documentation

2014-04-10 Thread Eric O. LEBIGOT
New submission from Eric O. LEBIGOT: The documentation for a None (empty) format for floats indicates that it is equivalent to the g format. This does not appear to be correct (http://stackoverflow.com/questions/16525924/precise-definition-of-float-string-formatting). The Python 3.4 documentat