[Python-Dev] PEP 515: Underscores in Numeric Literals

Chris Barker chris.barker at noaa.gov
Fri Feb 12 15:06:04 EST 2016


On Fri, Feb 12, 2016 at 1:00 AM, Paul Moore <p.f.moore at gmail.com> wrote:

>
> I have no opinion on anything other than that whatever syntax is
> implemented as long as it allows single underscores between digits,
> such as
>
> 1_000_000
>
> Everything else is irrelevant to me, and if I read code that uses
> anything else, I'd judge it based on readability and style, and
> wouldn't care about arguments that "it's allowed by the grammar".


I totally agree -- and it's clear that other cultures group digits
differently, so we should allow that, but while I'll live with it either
way, I'd rather have it be as restrictive as possible rather than as
unrestricted as possible. As in:

no double underscores
no underscore right before or after a period
no underscore at the beginning or end.
....

As Paul said, as long as I can do the above, I'll be fine, but I think
everyone's source code will be a lot cleaner in the long run if you don't
have the option of doing who knows what weird arrangement....

As for the SS# example -- it seems a bad idea to me to store a SS# number
as an integer anyway -- so all the weird IDs etc. formats aren't really
relevant...

-CHB



-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20160212/7de3677e/attachment.html>


More information about the Python-Dev mailing list