I know that _s can be used as digit separator within numeric literals, between (groups of) digits, for instance 1_000 means 1000 and 0_0 means 00 or just 0. Today I accidentally typed a letter after the underscore, say 0_z. After pressing Enter, IPython showed the continuation prompt and the cursor: it expected more! But what? Example:
Python 3.12.7 (tags/v3.12.7:0b05ead, Oct 1 2024, 03:06:41) [MSC v.1941 64 bit (AMD64)]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.31.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: 0_z
...:
...:
...: |
The vanilla Python prompt gives an expected syntax error instead:
Python 3.12.7 (tags/v3.12.7:0b05ead, Oct 1 2024, 03:06:41) [MSC v.1941 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> 0_z
File "<stdin>", line 1
0_z
^
SyntaxError: invalid decimal literal
Or course Ctrl+C gets me out of the problem. But exactly what (feature?) got me into it?