New submission from Nick Coghlan <ncogh...@gmail.com>:

I just noticed that https://docs.python.org/3/library/string.html#formatspec 
links to the "integer" definition in the main Python grammar for the permitted 
format of numeric fields.
This isn't accurate:

```
>>> format(10e4, ",.2f")
'100,000.00'
>>> format(10e4, ",.0x2f")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: Invalid format specifier
>>> format(10e4, ",.2_2f")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: Invalid format specifier
```

Instead, the `width` and `precision` subfields should be defined as "digit+"

----------
assignee: docs@python
components: Documentation
messages: 311229
nosy: docs@python, ncoghlan
priority: normal
severity: normal
stage: needs patch
status: open
title: Format mini-language integer definition is incorrect
type: behavior
versions: Python 3.6, Python 3.7, Python 3.8

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32720>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to