[Python-ideas] Proposal for default character representation

Chris Angelico rosuav at gmail.com
Thu Oct 13 06:43:01 EDT 2016


On Thu, Oct 13, 2016 at 9:05 PM, Cory Benfield <cory at lukasa.co.uk> wrote:
> Binary notation seems like the solution, but note the above case: the only way to work out how many bits are being masked out is to count them, and there can be quite a lot. IIRC there’s some new syntax coming for binary literals that would let us represent them as 0b1111_1111_1111_1111, which would help the readability case, but it’s still substantially less dense and loses clarity for many kinds of unusual bit patterns.
>

And if you were to write them like this, you would start to read them
in blocks of four - effectively, treating each underscore-separated
unit as a glyph, despite them being represented with four characters.
Fortunately, just like with Hangul characters, we have a
transformation that combines these multi-character glyphs into single
characters. We call it 'hexadecimal'.

ChrisA


More information about the Python-ideas mailing list