[Python-Dev] Re: String module

Guido van Rossum guido@python.org
Wed, 29 May 2002 15:32:00 -0400


> FYI, Unicode has these:
> 
>      {"islower", (PyCFunction) unicode_islower, METH_NOARGS, islower__doc__},
>      {"isupper", (PyCFunction) unicode_isupper, METH_NOARGS, isupper__doc__},
>      {"istitle", (PyCFunction) unicode_istitle, METH_NOARGS, istitle__doc__},
>      {"isspace", (PyCFunction) unicode_isspace, METH_NOARGS, isspace__doc__},
>      {"isdecimal", (PyCFunction) unicode_isdecimal, METH_NOARGS, isdecimal__doc__},
>      {"isdigit", (PyCFunction) unicode_isdigit, METH_NOARGS, isdigit__doc__},
>      {"isnumeric", (PyCFunction) unicode_isnumeric, METH_NOARGS, isnumeric__doc__},
>      {"isalpha", (PyCFunction) unicode_isalpha, METH_NOARGS, isalpha__doc__},
>      {"isalnum", (PyCFunction) unicode_isalnum, METH_NOARGS, isalnum__doc__},
> 
> Note that unlike for ASCII strings, the characters all have
> defined categories.
> 
> Strings miss a few of these:
> 
> 	{"islower", (PyCFunction)string_islower, METH_NOARGS, islower__doc__},
> 	{"isupper", (PyCFunction)string_isupper, METH_NOARGS, isupper__doc__},
> 	{"isspace", (PyCFunction)string_isspace, METH_NOARGS, isspace__doc__},
> 	{"isdigit", (PyCFunction)string_isdigit, METH_NOARGS, isdigit__doc__},
> 	{"istitle", (PyCFunction)string_istitle, METH_NOARGS, istitle__doc__},
> 	{"isalpha", (PyCFunction)string_isalpha, METH_NOARGS, isalpha__doc__},
> 	{"isalnum", (PyCFunction)string_isalnum, METH_NOARGS, isalnum__doc__},

I think all of the unicode methods should be added to 8-bit strings,
even if they are just aliases for others (what's title case applied to
Latin-1?  I suppose same as upper case?).

--Guido van Rossum (home page: http://www.python.org/~guido/)