summaryrefslogtreecommitdiffstats
path: root/Objects/stringobject.c
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2003-10-18 09:55:08 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2003-10-18 09:55:08 (GMT)
commit6828e18a6a0d63f2203f5043bda0018925244188 (patch)
treeeddebe1c7f67df0286ae57d1862231c946a888e5 /Objects/stringobject.c
parent849a972f35a6740c4784c80a8271af9f5592d7b6 (diff)
downloadcpython-6828e18a6a0d63f2203f5043bda0018925244188.zip
cpython-6828e18a6a0d63f2203f5043bda0018925244188.tar.gz
cpython-6828e18a6a0d63f2203f5043bda0018925244188.tar.bz2
Patch #825679: Clarify semantics of .isfoo on empty strings.
Backported to 2.3.
Diffstat (limited to 'Objects/stringobject.c')
-rw-r--r--Objects/stringobject.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/Objects/stringobject.c b/Objects/stringobject.c
index 04c9c98..7143a81 100644
--- a/Objects/stringobject.c
+++ b/Objects/stringobject.c
@@ -2733,10 +2733,10 @@ string_zfill(PyStringObject *self, PyObject *args)
}
PyDoc_STRVAR(isspace__doc__,
-"S.isspace() -> bool\n"
-"\n"
-"Return True if there are only whitespace characters in S,\n"
-"False otherwise.");
+"S.isspace() -> bool\n\
+\n\
+Return True if all characters in S are whitespace\n\
+and there is at least one character in S, False otherwise.");
static PyObject*
string_isspace(PyStringObject *self)
@@ -2766,7 +2766,7 @@ string_isspace(PyStringObject *self)
PyDoc_STRVAR(isalpha__doc__,
"S.isalpha() -> bool\n\
\n\
-Return True if all characters in S are alphabetic\n\
+Return True if all characters in S are alphabetic\n\
and there is at least one character in S, False otherwise.");
static PyObject*
@@ -2797,7 +2797,7 @@ string_isalpha(PyStringObject *self)
PyDoc_STRVAR(isalnum__doc__,
"S.isalnum() -> bool\n\
\n\
-Return True if all characters in S are alphanumeric\n\
+Return True if all characters in S are alphanumeric\n\
and there is at least one character in S, False otherwise.");
static PyObject*
@@ -2828,8 +2828,8 @@ string_isalnum(PyStringObject *self)
PyDoc_STRVAR(isdigit__doc__,
"S.isdigit() -> bool\n\
\n\
-Return True if there are only digit characters in S,\n\
-False otherwise.");
+Return True if all characters in S are digits\n\
+and there is at least one character in S, False otherwise.");
static PyObject*
string_isdigit(PyStringObject *self)
@@ -2893,7 +2893,7 @@ string_islower(PyStringObject *self)
PyDoc_STRVAR(isupper__doc__,
"S.isupper() -> bool\n\
\n\
-Return True if all cased characters in S are uppercase and there is\n\
+Return True if all cased characters in S are uppercase and there is\n\
at least one cased character in S, False otherwise.");
static PyObject*
@@ -2927,9 +2927,10 @@ string_isupper(PyStringObject *self)
PyDoc_STRVAR(istitle__doc__,
"S.istitle() -> bool\n\
\n\
-Return True if S is a titlecased string, i.e. uppercase characters\n\
-may only follow uncased characters and lowercase characters only cased\n\
-ones. Return False otherwise.");
+Return True if S is a titlecased string and there is at least one\n\
+character in S, i.e. uppercase characters may only follow uncased\n\
+characters and lowercase characters only cased ones. Return False\n\
+otherwise.");
static PyObject*
string_istitle(PyStringObject *self, PyObject *uncased)