[issue26331] Tokenizer: allow underscores for grouping in numeric literals

Georg Brandl report at bugs.python.org
Wed Feb 10 13:43:40 EST 2016


Georg Brandl added the comment:

It sure is more strict, but I don't think it's simpler (and it's definitely not simpler to implement).

(Also 1_j is pretty nice, I wouldn't want to lose that.)

We can also check what other languages do.

* Rust: very much like this, but trailing underscores allowed.
* Perl 5: same as here, but underscores after dot and trailing underscores allowed.
* Ruby: only between digits.

* Swift: the grammar productions say it's basically the same as Rust.  The textual description says "between digits".

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue26331>
_______________________________________


More information about the Python-bugs-list mailing list