2 ms·
Python already uses alternative representations for Strings since Python 3.3 as much I know. When latin-1 (ISO-8859-1) is enough, one byte per code point is use
by PythonicAlpha 11y ago
Python already uses alternative representations for Strings since Python 3.3 as much I know. When latin-1 (ISO-8859-1) is enough, one byte per code point is used, when UCS16 is sufficient 2 bytes and 4 bytes in all other cases. So the whole range of Unicode is supported and still the representation is space efficient and because inside one string every code point has the same size, the speed is also acceptable.