/* Special case for empty strings */
if (length == 0)
- return PyBool_FromLong(0);
+ Py_RETURN_FALSE;
cased = 0;
for (i = 0; i < length; i++) {
const Py_UCS4 ch = PyUnicode_READ(kind, data, i);
if (Py_UNICODE_ISUPPER(ch) || Py_UNICODE_ISTITLE(ch))
- return PyBool_FromLong(0);
+ Py_RETURN_FALSE;
else if (!cased && Py_UNICODE_ISLOWER(ch))
cased = 1;
}
/* Special case for empty strings */
if (length == 0)
- return PyBool_FromLong(0);
+ Py_RETURN_FALSE;
cased = 0;
for (i = 0; i < length; i++) {
const Py_UCS4 ch = PyUnicode_READ(kind, data, i);
if (Py_UNICODE_ISLOWER(ch) || Py_UNICODE_ISTITLE(ch))
- return PyBool_FromLong(0);
+ Py_RETURN_FALSE;
else if (!cased && Py_UNICODE_ISUPPER(ch))
cased = 1;
}
/* Special case for empty strings */
if (length == 0)
- return PyBool_FromLong(0);
+ Py_RETURN_FALSE;
cased = 0;
previous_is_cased = 0;
if (Py_UNICODE_ISUPPER(ch) || Py_UNICODE_ISTITLE(ch)) {
if (previous_is_cased)
- return PyBool_FromLong(0);
+ Py_RETURN_FALSE;
previous_is_cased = 1;
cased = 1;
}
else if (Py_UNICODE_ISLOWER(ch)) {
if (!previous_is_cased)
- return PyBool_FromLong(0);
+ Py_RETURN_FALSE;
previous_is_cased = 1;
cased = 1;
}
/* Special case for empty strings */
if (length == 0)
- return PyBool_FromLong(0);
+ Py_RETURN_FALSE;
for (i = 0; i < length; i++) {
const Py_UCS4 ch = PyUnicode_READ(kind, data, i);
if (!Py_UNICODE_ISSPACE(ch))
- return PyBool_FromLong(0);
+ Py_RETURN_FALSE;
}
- return PyBool_FromLong(1);
+ Py_RETURN_TRUE;
}
/*[clinic input]
/* Special case for empty strings */
if (length == 0)
- return PyBool_FromLong(0);
+ Py_RETURN_FALSE;
for (i = 0; i < length; i++) {
if (!Py_UNICODE_ISALPHA(PyUnicode_READ(kind, data, i)))
- return PyBool_FromLong(0);
+ Py_RETURN_FALSE;
}
- return PyBool_FromLong(1);
+ Py_RETURN_TRUE;
}
/*[clinic input]
/* Special case for empty strings */
if (len == 0)
- return PyBool_FromLong(0);
+ Py_RETURN_FALSE;
for (i = 0; i < len; i++) {
const Py_UCS4 ch = PyUnicode_READ(kind, data, i);
if (!Py_UNICODE_ISALNUM(ch))
- return PyBool_FromLong(0);
+ Py_RETURN_FALSE;
}
- return PyBool_FromLong(1);
+ Py_RETURN_TRUE;
}
/*[clinic input]
/* Special case for empty strings */
if (length == 0)
- return PyBool_FromLong(0);
+ Py_RETURN_FALSE;
for (i = 0; i < length; i++) {
if (!Py_UNICODE_ISDECIMAL(PyUnicode_READ(kind, data, i)))
- return PyBool_FromLong(0);
+ Py_RETURN_FALSE;
}
- return PyBool_FromLong(1);
+ Py_RETURN_TRUE;
}
/*[clinic input]
/* Special case for empty strings */
if (length == 0)
- return PyBool_FromLong(0);
+ Py_RETURN_FALSE;
for (i = 0; i < length; i++) {
if (!Py_UNICODE_ISDIGIT(PyUnicode_READ(kind, data, i)))
- return PyBool_FromLong(0);
+ Py_RETURN_FALSE;
}
- return PyBool_FromLong(1);
+ Py_RETURN_TRUE;
}
/*[clinic input]
/* Special case for empty strings */
if (length == 0)
- return PyBool_FromLong(0);
+ Py_RETURN_FALSE;
for (i = 0; i < length; i++) {
if (!Py_UNICODE_ISNUMERIC(PyUnicode_READ(kind, data, i)))
- return PyBool_FromLong(0);
+ Py_RETURN_FALSE;
}
- return PyBool_FromLong(1);
+ Py_RETURN_TRUE;
}
int