-
-
Notifications
You must be signed in to change notification settings - Fork 33.3k
gh-129117: Expose _PyUnicode_IsXidContinue/Start in unicodedata
#140269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I don't know these Unicode properties. The PR documentation doesn't help me:
What does it mean |
|
Ah no worries then. You can find their documentation in this report, I can add a link to it in the docs. |
|
In short, these functions check if a character is an identifier start or an identifier character according to Unicode TR31? |
|
Yes. |
This reverts commit b24b994.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM now
|
I have made the requested changes; please review again |
|
Thanks for making the requested changes! @malemburg: please review the changes made to this pull request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @StanFromIreland
This looks pretty complete now.
|
Thanks for the reviews! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change is correct, but I'm not convinced that we have to expose this feature in Python. It seems to be an Unicode feature which rarely used.
|
Have a look at https://peps.python.org/pep-3131/ for why these are important to have. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
About function names, the Unicode annex has also ID_Start and ID_Continue. The XID is a variant. Maybe we should keep x in the function names?
Note that they explicitly recommend the "X" variants. |
You have a point there. Let's keep the "x" in "xid" for the functions to not cause confusion. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
Thanks for merging! |
📚 Documentation preview 📚: https://cpython-previews--140269.org.readthedocs.build/