New submission from FHTMitchell <[email protected]>:
Minor issue. Using the ',b', ',o' or ',x' raises the error
ValueError("Cannot specify ',' or '_' with 'x'.",)
(or equivalently for 'b' and 'o'). However, it is possible to use the format
specs '_b', '_o' and '_x' in Python 3.6 due to PEP 515.
The following test demonstrates this:
>>> i = 10000
>>> for base in 'box':
... for sep in ',_':
... try:
... print(f'{i:{sep}{base}}')
... except ValueError as err:
... print(repr(err))
ValueError("Cannot specify ',' or '_' with 'b'.",)
1_1000_0110_1010_0000
ValueError("Cannot specify ',' or '_' with 'o'.",)
30_3240
ValueError("Cannot specify ',' or '_' with 'x'.",)
1_86a0
----------
messages: 304330
nosy: FHTMitchell
priority: normal
severity: normal
status: open
title: Using format spec ',x' displays incorrect error message
type: behavior
versions: Python 3.6
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue31780>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com