]> granicus.if.org Git - python/commitdiff
Modified the ISALPHA and ISALNUM macros to use the new lookup APIs
authorMarc-André Lemburg <mal@egenix.com>
Wed, 5 Jul 2000 09:45:59 +0000 (09:45 +0000)
committerMarc-André Lemburg <mal@egenix.com>
Wed, 5 Jul 2000 09:45:59 +0000 (09:45 +0000)
from unicodectype.c

Include/unicodeobject.h

index f076fae53bbc004ba3f015670fcccd0d4cdcb082..74cb0334db84088517a822ca9127d765b20bd978 100644 (file)
@@ -137,6 +137,8 @@ typedef unsigned short Py_UNICODE;
 #define Py_UNICODE_TODIGIT(ch) _PyUnicode_ToDigit(ch)
 #define Py_UNICODE_TONUMERIC(ch) _PyUnicode_ToNumeric(ch)
 
+#define Py_UNICODE_ISALPHA(ch) iswalpha(ch)
+
 #else
 
 #define Py_UNICODE_ISSPACE(ch) _PyUnicode_IsWhitespace(ch)
@@ -158,12 +160,9 @@ typedef unsigned short Py_UNICODE;
 #define Py_UNICODE_TODIGIT(ch) _PyUnicode_ToDigit(ch)
 #define Py_UNICODE_TONUMERIC(ch) _PyUnicode_ToNumeric(ch)
 
-#endif
+#define Py_UNICODE_ISALPHA(ch) _PyUnicode_IsAlpha(ch)
 
-#define Py_UNICODE_ISALPHA(ch) \
-       (Py_UNICODE_ISLOWER(ch) || \
-        Py_UNICODE_ISUPPER(ch) || \
-        Py_UNICODE_ISTITLE(ch))
+#endif
 
 #define Py_UNICODE_ISALNUM(ch) \
        (Py_UNICODE_ISALPHA(ch) || \
@@ -871,6 +870,10 @@ extern DL_IMPORT(int) _PyUnicode_IsNumeric(
     register const Py_UNICODE ch       /* Unicode character */
     );
 
+extern DL_IMPORT(int) _PyUnicode_IsAlpha(
+    register const Py_UNICODE ch       /* Unicode character */
+    );
+
 #ifdef __cplusplus
 }
 #endif