diff options
author | INADA Naoki <methane@users.noreply.github.com> | 2018-01-27 05:06:21 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-27 05:06:21 (GMT) |
commit | a49ac9902903a798fab4970ccf563c531199c3f8 (patch) | |
tree | 56390f8d6849446b23d3d2a152c6197fc724ae70 /Objects/clinic | |
parent | 85527cf50a9a4eecaca4022f7c6cb9e0bae1fa5f (diff) | |
download | cpython-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/clinic')
-rw-r--r-- | Objects/clinic/unicodeobject.c.h | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/Objects/clinic/unicodeobject.c.h b/Objects/clinic/unicodeobject.c.h index 643ef04..8072516 100644 --- a/Objects/clinic/unicodeobject.c.h +++ b/Objects/clinic/unicodeobject.c.h @@ -165,6 +165,27 @@ exit: return return_value; } +PyDoc_STRVAR(unicode_isascii__doc__, +"isascii($self, /)\n" +"--\n" +"\n" +"Return True if all characters in the string are ASCII, False otherwise.\n" +"\n" +"ASCII characters have code points in the range U+0000-U+007F.\n" +"Empty string is ASCII too."); + +#define UNICODE_ISASCII_METHODDEF \ + {"isascii", (PyCFunction)unicode_isascii, METH_NOARGS, unicode_isascii__doc__}, + +static PyObject * +unicode_isascii_impl(PyObject *self); + +static PyObject * +unicode_isascii(PyObject *self, PyObject *Py_UNUSED(ignored)) +{ + return unicode_isascii_impl(self); +} + PyDoc_STRVAR(unicode_islower__doc__, "islower($self, /)\n" "--\n" @@ -930,4 +951,4 @@ unicode_sizeof(PyObject *self, PyObject *Py_UNUSED(ignored)) { return unicode_sizeof_impl(self); } -/*[clinic end generated code: output=1ad4e81b68194264 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=561c88c912b8fe3b input=a9049054013a1b77]*/ |