While attending a great presentation of Kaitai Struct at Hack.lu 2025, I noticed a binary numeric notation during the demo, that I had never seen before. Something like 0b1000_0001.
I’m familiar with notations in Python like 0b10000001, but not with an underscore thrown in to make the number more readable.
Turns out this exists for almost 10 years in Python (since Python 3.6), and that it is known as PEP 515 – Underscores in Numeric Literals.
And it exists in other programming languages too.
Click to Open Code Editor