Skip to content

It's undocumented, that comma is invalid as separator for "b", "o" and "x" integer types #127852

@skirpichev

Description

@skirpichev
>>> format(12347834, '_x')
'bc_69ba'
>>> format(12347834, ',x')
Traceback (most recent call last):
  File "<python-input-1>", line 1, in <module>
    format(12347834, ',x')
    ~~~~~~^^^^^^^^^^^^^^^^
ValueError: Cannot specify ',' with 'x'.
>>> format(12347834, ',b')
Traceback (most recent call last):
  File "<python-input-2>", line 1, in <module>
    format(12347834, ',b')
    ~~~~~~^^^^^^^^^^^^^^^^
ValueError: Cannot specify ',' with 'b'.
>>> format(12347834, ',o')
Traceback (most recent call last):
  File "<python-input-3>", line 1, in <module>
    format(12347834, ',o')
    ~~~~~~^^^^^^^^^^^^^^^^
ValueError: Cannot specify ',' with 'o'.
>>> format(12347834, ',d')
'12,347,834'
>>> format(12347111111111834, ',f')
'12,347,111,111,111,834.000000'

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dir

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions