File tree Expand file tree Collapse file tree 3 files changed +11
-13
lines changed
Expand file tree Collapse file tree 3 files changed +11
-13
lines changed Original file line number Diff line number Diff line change @@ -146,8 +146,9 @@ following functions:
146146
147147.. function :: isidstart(chr, /)
148148
149- Return ``True `` if the character has the ``XID_Start `` property, ``False ``
150- otherwise. For example::
149+ Return ``True `` if *chr * is a valid identifier start per the
150+ `Unicode Standard Annex #31 <https://www.unicode.org/reports/tr31/ >`_,
151+ that is, it has the ``XID_Start `` property, ``False `` otherwise. For example::
151152
152153 >>> unicodedata.isidstart('S')
153154 True
@@ -159,8 +160,9 @@ following functions:
159160
160161.. function :: isidcontinue(chr, /)
161162
162- Return ``True `` if the character has the ``XID_Continue `` property, ``False ``
163- otherwise. For example::
163+ Return ``True `` if *chr * is a valid identifier charcter per the
164+ `Unicode Standard Annex #31 <https://www.unicode.org/reports/tr31/ >`_,
165+ that is, it has the ``XID_Continue `` property, ``False `` otherwise. For example::
164166
165167 >>> unicodedata.isidcontinue('S')
166168 True
Original file line number Diff line number Diff line change @@ -1541,17 +1541,15 @@ static PyObject *
15411541unicodedata_UCD_isidstart_impl (PyObject * self , int chr )
15421542/*[clinic end generated code: output=29fbeaf6491d9f85 input=b71b6b1b2db3c16d]*/
15431543{
1544- Py_UCS4 c = (Py_UCS4 )chr ;
1545-
15461544 if (UCD_Check (self )) {
1547- const change_record * old = get_old_record (self , c );
1545+ const change_record * old = get_old_record (self , chr );
15481546 if (old -> category_changed == 0 ) {
15491547 /* unassigned */
15501548 Py_RETURN_FALSE ;
15511549 }
15521550 }
15531551
1554- return PyBool_FromLong (_PyUnicode_IsXidStart (c ));
1552+ return PyBool_FromLong (_PyUnicode_IsXidStart (chr ));
15551553}
15561554
15571555/*[clinic input]
@@ -1569,17 +1567,15 @@ static PyObject *
15691567unicodedata_UCD_isidcontinue_impl (PyObject * self , int chr )
15701568/*[clinic end generated code: output=5ae694da0ee16534 input=01b4ccd399484e6b]*/
15711569{
1572- Py_UCS4 c = (Py_UCS4 )chr ;
1573-
15741570 if (UCD_Check (self )) {
1575- const change_record * old = get_old_record (self , c );
1571+ const change_record * old = get_old_record (self , chr );
15761572 if (old -> category_changed == 0 ) {
15771573 /* unassigned */
15781574 Py_RETURN_FALSE ;
15791575 }
15801576 }
15811577
1582- return PyBool_FromLong (_PyUnicode_IsXidContinue (c ));
1578+ return PyBool_FromLong (_PyUnicode_IsXidContinue (chr ));
15831579}
15841580
15851581/*[clinic input]
Original file line number Diff line number Diff line change 99*/
1010
1111#include "Python.h"
12- #include "pycore_unicodedata.h" // _PyUnicode_IsXidStart, _PyUnicode_IsXidContinue
12+ #include "pycore_unicodedata.h" // export _PyUnicode_IsXidStart() , _PyUnicode_IsXidContinue()
1313
1414#define ALPHA_MASK 0x01
1515#define DECIMAL_MASK 0x02
You can’t perform that action at this time.
0 commit comments