Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-105156: Cleanup usage of old Py_UNICODE type#105158

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
vstinner merged 2 commits intopython:mainfromvstinner:cleanup_py_unicode
Jun 1, 2023

Conversation

vstinner
Copy link
Member

@vstinnervstinner commentedMay 31, 2023
edited by github-actionsbot
Loading

  • refcounts.dat:

    • Remove Py_UNICODE functions
    • Replace Py_UNICODE argument type with wchar_t
  • _PyUnicode_ToLowercase(), _PyUnicode_ToUppercase(), _PyUnicode_ToTitlecase() are no longer deprecate in comment. It's no longer needed since they now use Py_UCS4 type, rather than the deprecated Py_UNICODE type.

  • gdb: Remove unused char_width() method.


📚 Documentation preview 📚:https://cpython-previews--105158.org.readthedocs.build/

* refcounts.dat:  * Remove Py_UNICODE functions  * Replace Py_UNICODE argument type with wchar_t* _PyUnicode_ToLowercase(), _PyUnicode_ToUppercase(),  _PyUnicode_ToTitlecase() are no longer deprecate in comment.  It's no longer needed since they now use Py_UCS4 type, rather than  the deprecated Py_UNICODE type.* gdb: Remove unused char_width() method.
@vstinner
Copy link
MemberAuthor

cc@methane


# Convert the int code points to unicode characters, and generate a
# local unicode instance.
result = u''.join(map(chr,Py_UNICODEs))
result = u''.join(map(chr,characters))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
result=u''.join(map(chr,characters))
result=''.join(map(chr,characters))

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Removing supporting for Python 2 require way more changes. I prefer to restrict changes to just Py_UNICODE here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

FYI, I removed Python 2 support from libpython.py already.
https://github.com/python/cpython/pull/31717/files

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Oh I didn't know. Well, feel free to remove thatu prefix in a separated PR :-) My PR doesn't add it at least :-)

@vstinnervstinnerenabled auto-merge (squash)June 1, 2023 07:15
@vstinnervstinner merged commit7d07e58 intopython:mainJun 1, 2023
@vstinnervstinner deleted the cleanup_py_unicode branchJune 1, 2023 07:18
@vstinner
Copy link
MemberAuthor

Merged. Thanks for your review@methane.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@methanemethanemethane left review comments

Assignees
No one assigned
Labels
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@vstinner@methane@bedevere-bot

[8]ページ先頭

©2009-2025 Movatter.jp