Update PEP 515: the "_" format specifier is now accepted.
This commit is contained in:
parent
c1eb956ea8
commit
013c3926a8
23
pep-0515.txt
23
pep-0515.txt
|
@ -83,6 +83,20 @@ the following constructors:
|
|||
- ``complex()``
|
||||
- ``Decimal()``
|
||||
|
||||
Further changes
|
||||
---------------
|
||||
|
||||
The new-style number-to-string formatting language will be extended to
|
||||
allow ``_`` as a thousands separator, where currently only ``,`` is
|
||||
supported. This can be used to easily generate code with more
|
||||
readable literals. [11]_
|
||||
|
||||
The syntax would be the same as for the comma, e.g. ``{:10_}`` for a
|
||||
width of 10 with ``_`` separator.
|
||||
|
||||
For the ``b``, ``x`` and ``o`` format specifiers, ``_`` will be
|
||||
allowed and group by 4 digits.
|
||||
|
||||
|
||||
Prior Art
|
||||
=========
|
||||
|
@ -149,15 +163,6 @@ introduce ambiguity with user-defined literals), which is not
|
|||
considered because of the use in Python's string literals. [1]_
|
||||
|
||||
|
||||
Open Proposals
|
||||
==============
|
||||
|
||||
It has been proposed [11]_ to extend the number-to-string formatting
|
||||
language to allow ``_`` as a thousans separator, where currently only
|
||||
``,`` is supported. This could be used to easily generate code with
|
||||
more readable literals.
|
||||
|
||||
|
||||
Implementation
|
||||
==============
|
||||
|
||||
|
|
Loading…
Reference in New Issue