isspace(*p))
return PyInt_FromLong(1);
+ /* Special case for empty strings */
+ if (PyString_GET_SIZE(self) == 0)
+ return PyInt_FromLong(0);
+
e = p + PyString_GET_SIZE(self);
for (; p < e; p++) {
if (!isspace(*p))
isdigit(*p))
return PyInt_FromLong(1);
+ /* Special case for empty strings */
+ if (PyString_GET_SIZE(self) == 0)
+ return PyInt_FromLong(0);
+
e = p + PyString_GET_SIZE(self);
for (; p < e; p++) {
if (!isdigit(*p))
if (PyString_GET_SIZE(self) == 1)
return PyInt_FromLong(islower(*p) != 0);
+ /* Special case for empty strings */
+ if (PyString_GET_SIZE(self) == 0)
+ return PyInt_FromLong(0);
+
e = p + PyString_GET_SIZE(self);
cased = 0;
for (; p < e; p++) {
if (PyString_GET_SIZE(self) == 1)
return PyInt_FromLong(isupper(*p) != 0);
+ /* Special case for empty strings */
+ if (PyString_GET_SIZE(self) == 0)
+ return PyInt_FromLong(0);
+
e = p + PyString_GET_SIZE(self);
cased = 0;
for (; p < e; p++) {
if (PyString_GET_SIZE(self) == 1)
return PyInt_FromLong(isupper(*p) != 0);
+ /* Special case for empty strings */
+ if (PyString_GET_SIZE(self) == 0)
+ return PyInt_FromLong(0);
+
e = p + PyString_GET_SIZE(self);
cased = 0;
previous_is_cased = 0;
if (PyUnicode_GET_SIZE(self) == 1)
return PyInt_FromLong(Py_UNICODE_ISLOWER(*p) != 0);
+ /* Special case for empty strings */
+ if (PyString_GET_SIZE(self) == 0)
+ return PyInt_FromLong(0);
+
e = p + PyUnicode_GET_SIZE(self);
cased = 0;
for (; p < e; p++) {
if (PyUnicode_GET_SIZE(self) == 1)
return PyInt_FromLong(Py_UNICODE_ISUPPER(*p) != 0);
+ /* Special case for empty strings */
+ if (PyString_GET_SIZE(self) == 0)
+ return PyInt_FromLong(0);
+
e = p + PyUnicode_GET_SIZE(self);
cased = 0;
for (; p < e; p++) {
return PyInt_FromLong((Py_UNICODE_ISTITLE(*p) != 0) ||
(Py_UNICODE_ISUPPER(*p) != 0));
+ /* Special case for empty strings */
+ if (PyString_GET_SIZE(self) == 0)
+ return PyInt_FromLong(0);
+
e = p + PyUnicode_GET_SIZE(self);
cased = 0;
previous_is_cased = 0;
Py_UNICODE_ISSPACE(*p))
return PyInt_FromLong(1);
+ /* Special case for empty strings */
+ if (PyString_GET_SIZE(self) == 0)
+ return PyInt_FromLong(0);
+
e = p + PyUnicode_GET_SIZE(self);
for (; p < e; p++) {
if (!Py_UNICODE_ISSPACE(*p))
Py_UNICODE_ISDECIMAL(*p))
return PyInt_FromLong(1);
+ /* Special case for empty strings */
+ if (PyString_GET_SIZE(self) == 0)
+ return PyInt_FromLong(0);
+
e = p + PyUnicode_GET_SIZE(self);
for (; p < e; p++) {
if (!Py_UNICODE_ISDECIMAL(*p))
Py_UNICODE_ISDIGIT(*p))
return PyInt_FromLong(1);
+ /* Special case for empty strings */
+ if (PyString_GET_SIZE(self) == 0)
+ return PyInt_FromLong(0);
+
e = p + PyUnicode_GET_SIZE(self);
for (; p < e; p++) {
if (!Py_UNICODE_ISDIGIT(*p))
Py_UNICODE_ISNUMERIC(*p))
return PyInt_FromLong(1);
+ /* Special case for empty strings */
+ if (PyString_GET_SIZE(self) == 0)
+ return PyInt_FromLong(0);
+
e = p + PyUnicode_GET_SIZE(self);
for (; p < e; p++) {
if (!Py_UNICODE_ISNUMERIC(*p))