[Python-3000] String comparison

Steve Howell showell30 at yahoo.com
Thu Jun 7 07:00:11 CEST 2007


--- Guido van Rossum <guido at python.org> wrote:
>
http://www.unicode.org/versions/Unicode4.0.0/ch03.pdf
> (Conformance)
> >
> > C9 A process shall not assume that the
> interpretations of two
> > canonical-equivalent character sequences are
> distinct.
> 
> That is surely contained inside all sorts of weasel
> words that allow
> us to define a "normalized equivalence" function
> that works that way,
> and leave the "==" operator for arrays of code
> points alone.
> 

Regarding weasel words, my reading of the text below
(particularly the word "Ideally") is that processes
should not make assumptions about other processes, but
C9 is not strict on how processes themselves behave.

'''
C9 A process shall not assume that the interpretations
of two canonical-equivalent character
sequences are distinct.

The implications of this conformance clause are
twofold. First, a process is never
required to give different interpretations to two
different, but canonical-equivalent
character sequences. Second, no process can assume
that another process will make
a distinction between two different, but
canonical-equivalent character sequences.

*Ideally* [emphasis added], an implementation would
always interpret two canonical-equivalent character
sequences identically. There are practical
circumstances under which implementations
may reasonably distinguish them.
'''

I guess you could interpret the following tidbit to
say that Python should never assume that text editors
will distinguish canonical-equivalent sequences, but I
doubt that settles any debate about what Python should
do, and I think I'm stretching the interpretation to
begin with:

'''
Second, no process can assume that another process
will make
a distinction between two different, but
canonical-equivalent character sequences.
'''


       
____________________________________________________________________________________
Choose the right car based on your needs.  Check out Yahoo! Autos new Car Finder tool.
http://autos.yahoo.com/carfinder/


More information about the Python-3000 mailing list