GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||
GeezerVison is showing github.com — gh-105156: Deprecate the old Py_UNICODE type in C API by vstinner · Pull Request #105157 · python/cpython Conversation
|
|
cc @methane |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Sourcegraph results: It seems two releases is not enough for removing |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
This PR is mostly about deprecation. I prefer to announce a Python release when these types will be removed, Python 3.15. But we will have to do this usage study again when these types will be removed for real. The warning should help users to find old code still using Py_UNICODE by mistake or not. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Fix here too. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
The first result is |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Co-authored-by: Inada Naoki <[email protected]>
I planned to write a separated PR for code generated by Argument Clinic. It's now done with: PR #105161. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I will wait until they 2 other PRs of this issue will be merged, to avoid emitting new compiler warnings. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Can we use It would avoid 2-vs-4-byte size discrepancy. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
At where? Py_UNICODE has been wchar_t since Python 3.3. Where Py_UNICODE was not required, my recommendation is "use UTF-8 always". |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Ah, I got it that the parent issue is about removal of a thin thus unnecessary typedef, not about changing the multybyte machinery for the next major version of CPython. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Initially I've got an impression that the PEP-393 removal of Now I see that this would require a PEP before the removal. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
That would be wrong. Python has many C functions which really expect 16-bit or 32-bit wchar_t like PyUnicode_FromWideChar().
There is Py_UCS4 which should be 32-bit and is able to store all Unicode characters.
Right. PEP 393 implementation first added many functions using Py_UCS4 arrays. It was inefficient since most of the time, all code points could be stored in Py_UCS1 arrays (4x smaller). Many strings are just ASCII. There are now more memory efficient structures. I also wrote _PyUnicodeWriter private API to change the internal storage depending on the maximum code point. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.