[docs] [issue22546] Wrong default precision in documentation for format

Tommy Andersen report at bugs.python.org
Fri Oct 3 11:31:18 CEST 2014


New submission from Tommy Andersen:

The format documentation for the Format Specification Mini-Language for python 3.3 (perhaps newer and older as well) at: https://docs.python.org/3.3/library/string.html 

States for type '' (for floating point numbers):

    Similar to 'g', except with at least one digit past the decimal point and a default precision of 12. This is intended to match str(), except you can add the other format modifiers.

This appears not to be true, the following code example, run in Python 3.3.2:

>>> '{}'.format(3.14159265358979323846264338327950288419)
'3.141592653589793'

As it can be seen form the output the default precision appears to be 15.

----------
assignee: docs at python
components: Documentation
messages: 228318
nosy: Barium, docs at python
priority: normal
severity: normal
status: open
title: Wrong default precision in documentation for format
versions: Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22546>
_______________________________________


More information about the docs mailing list