[Python-ideas] Support Unicode code point notation
Steven D'Aprano
steve at pearwood.info
Sat Jul 27 13:22:50 CEST 2013
On 27/07/13 20:22, Ian Foote wrote:
> On 27/07/13 11:01, Steven D'Aprano wrote:
>> Variable number of digits? Isn't that a bad thing?
>> --------------------------------------------------
>>
>> It's neither good nor bad. Octal escapes already support from 1 to 3 oct
>> digits. In some languages (but not Python), hex escapes support from 1
>> to an unlimited number of hex digits.
> What should 'U+12345' be? U+12345 CUNEIFORM SIGN URU TIMES KI or U+1234 ETHIOPIC SYLLABLE SEE and a digit 5?
There is no ambiguity. Just like oct escapes, the longest valid sequence (up to the maximum) would be used. If you used the shortest, then there would be no way to specify 5 or 6 digit sequences.
--
Steven
More information about the Python-ideas
mailing list