summaryrefslogtreecommitdiffstats
path: root/Objects/stringlib
diff options
context:
space:
mode:
authorINADA Naoki <methane@users.noreply.github.com>2018-01-27 05:06:21 (GMT)
committerGitHub <noreply@github.com>2018-01-27 05:06:21 (GMT)
commita49ac9902903a798fab4970ccf563c531199c3f8 (patch)
tree56390f8d6849446b23d3d2a152c6197fc724ae70 /Objects/stringlib
parent85527cf50a9a4eecaca4022f7c6cb9e0bae1fa5f (diff)
downloadcpython-a49ac9902903a798fab4970ccf563c531199c3f8.zip
cpython-a49ac9902903a798fab4970ccf563c531199c3f8.tar.gz
cpython-a49ac9902903a798fab4970ccf563c531199c3f8.tar.bz2
bpo-32677: Add .isascii() to str, bytes and bytearray (GH-5342)
Diffstat (limited to 'Objects/stringlib')
-rw-r--r--Objects/stringlib/ctype.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/Objects/stringlib/ctype.h b/Objects/stringlib/ctype.h
index f054625..fd7b1bd 100644
--- a/Objects/stringlib/ctype.h
+++ b/Objects/stringlib/ctype.h
@@ -23,6 +23,12 @@ stringlib_isalnum(PyObject *self)
}
static PyObject*
+stringlib_isascii(PyObject *self)
+{
+ return _Py_bytes_isascii(STRINGLIB_STR(self), STRINGLIB_LEN(self));
+}
+
+static PyObject*
stringlib_isdigit(PyObject *self)
{
return _Py_bytes_isdigit(STRINGLIB_STR(self), STRINGLIB_LEN(self));