summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2007-08-15 07:32:56 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2007-08-15 07:32:56 (GMT)
commit47383403a0a11259acb640406a8efc38981d2255 (patch)
treead461e275dc3f2607bab86bb596366d71489b453 /Include
parent32c4ac014387d3bffea5461339b8ad3044d0dafb (diff)
downloadcpython-47383403a0a11259acb640406a8efc38981d2255.zip
cpython-47383403a0a11259acb640406a8efc38981d2255.tar.gz
cpython-47383403a0a11259acb640406a8efc38981d2255.tar.bz2
Implement PEP 3131. Add isidentifier to str.
Diffstat (limited to 'Include')
-rw-r--r--Include/errcode.h1
-rw-r--r--Include/unicodeobject.h6
2 files changed, 7 insertions, 0 deletions
diff --git a/Include/errcode.h b/Include/errcode.h
index becec80..6bb3cc1 100644
--- a/Include/errcode.h
+++ b/Include/errcode.h
@@ -29,6 +29,7 @@ extern "C" {
#define E_EOFS 23 /* EOF in triple-quoted string */
#define E_EOLS 24 /* EOL in single-quoted string */
#define E_LINECONT 25 /* Unexpected characters after a line continuation */
+#define E_IDENTIFIER 26 /* Invalid characters in identifier */
#ifdef __cplusplus
}
diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h
index 54b7129..5545344 100644
--- a/Include/unicodeobject.h
+++ b/Include/unicodeobject.h
@@ -182,6 +182,7 @@ typedef PY_UNICODE_TYPE Py_UNICODE;
# define PyUnicode_GetDefaultEncoding PyUnicodeUCS2_GetDefaultEncoding
# define PyUnicode_GetMax PyUnicodeUCS2_GetMax
# define PyUnicode_GetSize PyUnicodeUCS2_GetSize
+# define PyUnicode_IsIdentifier PyUnicodeUCS2_IsIdentifier
# define PyUnicode_Join PyUnicodeUCS2_Join
# define PyUnicode_Partition PyUnicodeUCS2_Partition
# define PyUnicode_RPartition PyUnicodeUCS2_RPartition
@@ -268,6 +269,7 @@ typedef PY_UNICODE_TYPE Py_UNICODE;
# define PyUnicode_GetDefaultEncoding PyUnicodeUCS4_GetDefaultEncoding
# define PyUnicode_GetMax PyUnicodeUCS4_GetMax
# define PyUnicode_GetSize PyUnicodeUCS4_GetSize
+# define PyUnicode_IsIdentifier PyUnicodeUCS4_IsIdentifier
# define PyUnicode_Join PyUnicodeUCS4_Join
# define PyUnicode_Partition PyUnicodeUCS4_Partition
# define PyUnicode_RPartition PyUnicodeUCS4_RPartition
@@ -1250,6 +1252,10 @@ PyAPI_FUNC(int) PyUnicode_Contains(
PyObject *element /* Element string */
);
+/* Checks whether argument is a valid identifier. */
+
+PyAPI_FUNC(int) PyUnicode_IsIdentifier(PyObject *s);
+
/* Externally visible for str.strip(unicode) */
PyAPI_FUNC(PyObject *) _PyUnicode_XStrip(
PyUnicodeObject *self,