On Fri, 8 Apr 2022 at 00:48, Stephen J. Turnbull
<stephenjturnb...@gmail.com> wrote:
> 1.  Syntax, aka language support (the original suggestion of
>     user-defined literals fits here because either the way numbers are
>     parsed or the way '_' is parsed would have to change).
>
>     It's very difficult to get *any* syntax change in.  In particular,
>     changing '_' from an identifier component to an operator for
>     combining numeric literals would invalidate *tons* of code
>     (including internationalization code that is the 0.454kg nearest
>     my heart).  I can't imagine that being possible.

>>> 123_456
123456
>>> 123_456_
  File "<stdin>", line 1
    123_456_
           ^
SyntaxError: invalid decimal literal

Trailing underscore is currently invalid, so that would be fine.

ChrisA
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/5NWOFCEKMKMLXUNEJCF4GTPY6WPOMRDB/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to