mirror of
https://github.com/python/cpython.git
synced 2025-10-21 06:02:21 +00:00
don't check that the first character is XID_Continue
Current, XID_Continue is a superset of XID_Start, but that may sometime change.
This commit is contained in:
parent
d83f226d93
commit
9c6e6a0c7f
2 changed files with 2 additions and 5 deletions
|
@ -10196,7 +10196,7 @@ PyUnicode_IsIdentifier(PyObject *self)
|
|||
if (!_PyUnicode_IsXidStart(first) && first != 0x5F /* LOW LINE */)
|
||||
return 0;
|
||||
|
||||
for (i = 0; i < PyUnicode_GET_LENGTH(self); i++)
|
||||
for (i = 1; i < PyUnicode_GET_LENGTH(self); i++)
|
||||
if (!_PyUnicode_IsXidContinue(PyUnicode_READ(kind, data, i)))
|
||||
return 0;
|
||||
return 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue