[Python-Dev] unicode alphanumerics

Fredrik Lundh Fredrik Lundh" <effbot@telia.com
Sat, 1 Jul 2000 18:46:08 +0200


when looking through skip's coverage listing, I noted a bug in
SRE:

#define SRE_UNI_IS_ALNUM(ch) ((ch) < 256 ? isalnum((ch)) : 0)

this predicate is used for \w when a pattern is compiled using
the "unicode locale" (flag U), and should definitely not use 8-bit
locale stuff.

however, there's no such thing as a Py_UNICODE_ISALNUM
(or even a Py_UNICODE_ISALPHA).  what should I do?  how
about using:

    Py_UNICODE_ISLOWER ||   =20
    Py_UNICODE_ISUPPER ||
    Py_UNICODE_ISTITLE ||
    Py_UNICODE_ISDIGIT
   =20
</F>