[Python-Dev] Unicode exception indexing

Terry Reedy tjreedy at udel.edu
Thu Nov 3 22:19:10 CET 2011


On 11/3/2011 3:16 PM, Victor Stinner wrote:
> Le jeudi 3 novembre 2011 18:14:42, martin at v.loewis.de a écrit :
>> There is a backwards compatibility issue with PEP 393 and Unicode
>> exceptions: the start and end indices: are they Py_UNICODE indices, or
>> code point indices?

I had the impression that we were abolishing the wide versus narrow 
build difference and that this issue would disappear. I must have missed 
something.

>> So what should it be?
>
> I suggest to use code point indices. Code point indices is also now more
> "natural" with the PEP 393.

I think we should look forward, not backwards. Error messages are 
defined as undefined ;-). So I think we should do what is right for the 
new implementation. I suspect that means that I am agreeing with both 
Victor and Antoine.

> Because it is an incompatible change, it should be documented in the PEP and
> in the "What's new in Python 3.3" document.
...
> Yeah, O(n) should be avoided when is it possible.

Definitely to both.

-- 
Terry Jan Reedy




More information about the Python-Dev mailing list