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

2020-02-06 Thread Eric V. Smith
Eric V. Smith added the comment: Well, you asked why commas only work with decimals and I told you. Adding "_" would require a PEP. See PEP 378 if you want to write something similar for "_". I think it's a decent idea. You'll have to decide between 4 and 8 bits, and what to do with octal

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

2020-02-06 Thread Another One
Another One added the comment: Not for 3 bits, just for 4 bits, like this: >>> print("{:_b}".format(123456)) 1_1110_0010_0100_ And as I already said: "But '_' groups delimiter properly work with any integer representation including decimals, hexadecimals, binaries, octals, etc.." Not

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

2020-02-06 Thread Eric V. Smith
Eric V. Smith added the comment: No one thought it made sense to have a comma every 3 bits. Or for octal or hex, either. Do you have some specific use case where it makes sense? -- nosy: +eric.smith ___ Python tracker

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

2020-02-06 Thread Another One
New submission from Another One : Example for binary representation: >>> x = 123456 >>> print("{:,b}".format(x)) Traceback (most recent call last): File "", line 1, in print("{:,b}".format(x)) ValueError: Cannot specify ',' with 'b'. Why? Comma work only with decimals? But '_' groups