Same in Python 3 and Rust too.
https://www.python.org/dev/peps/pep-0515/
https://doc.rust-lang.org/rust-by-example/primitives/literal...
https://www.python.org/dev/peps/pep-0515/
https://doc.rust-lang.org/rust-by-example/primitives/literal...
https://github.com/dotnet/csharplang/blob/main/proposals/csh...
First time I saw it was in C#, I love it personally
0_0: Legal in Java, legal in Python, illegal in JavaScript.
0__0: Legal in Java, illegal in Python, illegal in JavaScript.
0x_0: Illegal in Java, legal in Python, illegal in JavaScript.
0_, 0_.0, 0._0: Illegal in all three.
It wouldn't surprise me if C# and C++(14) have differing edge cases too.
Isn't digit (["_"] "0")* simpler?
Python 3.6.3 (v3.6.3:2c5fed8, Oct 3 2017, 18:11:49) [MSC v.1900 64 bit (AMD64)]
Type 'copyright', 'credits' or 'license' for more information
IPython 7.2.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: 01
File "<ipython-input-1-3351d58b1d3b>", line 1
01
^
SyntaxError: invalid token
In [2]: 0o1
Out[2]: 1
In [3]: 0o10
Out[3]: 8https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/nume...