Update PEP 515: the "_" format specifier is now accepted.

This commit is contained in:
Georg Brandl 2016-03-19 07:49:20 +01:00
parent c1eb956ea8
commit 013c3926a8
1 changed files with 14 additions and 9 deletions

View File

@ -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
==============