<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#330033">
    <div class="moz-cite-prefix">On 2/10/2016 2:20 PM, Georg Brandl
      wrote:<br>
    </div>
    <blockquote cite="mid:n9gd3m$i7b$1@ger.gmane.org" type="cite">
      <pre wrap="">This came up in python-ideas, and has met mostly positive comments,
although the exact syntax rules are up for discussion.

cheers,
Georg

--------------------------------------------------------------------------------

PEP: 515
Title: Underscores in Numeric Literals
Version: $Revision$
Last-Modified: $Date$
Author: Georg Brandl
Status: Draft
Type: Standards Track
Content-Type: text/x-rst
Created: 10-Feb-2016
Python-Version: 3.6

Abstract and Rationale
======================

This PEP proposes to extend Python's syntax so that underscores can be used in
integral and floating-point number literals.

This is a common feature of other modern languages, and can aid readability of
long literals, or literals whose value should clearly separate into parts, such
as bytes or words in hexadecimal notation.

Examples::

    # grouping decimal numbers by thousands
    amount = 10_000_000.0

    # grouping hexadecimal addresses by words
    addr = 0xDEAD_BEEF

    # grouping bits into bytes in a binary literal
    flags = 0b_0011_1111_0100_1110
</pre>
    </blockquote>
    <br>
    +1<br>
    <br>
    You don't mention potential restrictions that decimal numbers should
    permit them only every three places, or hex ones only every 2 or 4,
    and your binary example mentions grouping into bytes, but actually
    groups into nybbles.<br>
    <br>
    But such restrictions would be annoying: if it is useful to the
    coder to use them, that is fine. But different situation may find
    other placements more useful... particularly in binary, as it might
    want to match widths of various bitfields.<br>
    <br>
    Adding that as a rejected consideration, with justifications, would
    be helpful.<br>
  </body>
</html>