[Python-3000] String comparison

Jim Jewett jimjjewett at gmail.com
Thu Jun 7 02:49:09 CEST 2007


On 6/6/07, Guido van Rossum <guido at python.org> wrote:
> On 6/6/07, Rauli Ruohonen <rauli.ruohonen at gmail.com> wrote:
> > On 6/6/07, Guido van Rossum <guido at python.org> wrote:
> > > Why should the lexer apply normalization to literals behind my back?

> > The lexer shouldn't, but NFC normalizing the source before the lexer
> > sees it would be slightly more robust and standards-compliant.

> I have no opinion on this, but NFC normalizing the source shouldn't
> affect the use of \u.... in string literals.

Agreed; normalizing the source should be applied only to code points;
the code sequence <0x5c, 0x75> normalizes to itself.  If there is a \u
in a string, it will still be there after normalization, before python
lexes.  If there is a \u outside a string, it will still be there to
cause syntax errors.

-jJ


More information about the Python-3000 mailing list