mirror of
https://github.com/python/cpython.git
synced 2025-07-15 23:35:23 +00:00
Implement PEP 3131. Add isidentifier to str.
This commit is contained in:
parent
32c4ac0143
commit
47383403a0
11 changed files with 152 additions and 5 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue