[issue39568] FORMATTING grouping_option ValueError: Cannot specify ', ' with ...

Another One report at bugs.python.org
Thu Feb 6 07:56:25 EST 2020


New submission from Another One <tn5v2l at gmail.com>:

Example for binary representation:

>>> x = 123456
>>> print("{:,b}".format(x))
Traceback (most recent call last):
  File "<pyshell#261>", line 1, in <module>
    print("{:,b}".format(x))
ValueError: Cannot specify ',' with 'b'.

Why? Comma work only with decimals?

But '_' groups delimiter properly work with any integer representation including decimals, hexadecimals, binaries, octals, etc..

----------
messages: 361480
nosy: Another One
priority: normal
severity: normal
status: open
title: FORMATTING grouping_option ValueError: Cannot specify ',' with ...
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39568>
_______________________________________


More information about the Python-bugs-list mailing list