[New-bugs-announce] [issue2264] empty specifier for float.__format__ does not always print at least one decimal digit

Eric Smith report at bugs.python.org
Mon Mar 10 12:05:24 CET 2008


New submission from Eric Smith <eric at trueblade.com>:

PEP 3101 specifies that the empty format presentation type for float
will always print at least one digit after the decimal point, but it
does not do that if the number is output with an exponent:

works:
>>> format(3.0, '')
'3.0'

fails:
>>> format(3e200, '')
'3e+200'

As currently implemented, the code just maps the empty format specifier
to 'g', and does not add the additional behavior specfied in the PEP.

----------
assignee: eric.smith
components: Interpreter Core
messages: 63438
nosy: eric.smith
priority: normal
severity: normal
status: open
title: empty specifier for float.__format__ does not always print at least one decimal digit
versions: Python 2.6, Python 3.0

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2264>
__________________________________


More information about the New-bugs-announce mailing list