
On Mon, Jun 15, 2020 at 4:25 PM Serhiy Storchaka <storchaka@gmail.com> wrote:
I have a plan for more graduate removing of this feature. I created a PR which adds several compile options, so Python can be built in one of three modes:
1. Support wchar_t* cache and use it. It is the current mode.
2. Support wchar_t* cache, but do not use it internally in CPython. It can be used to test whether getting rid of the wchar_t* cache can have negative effects.
3. Do not support wchar_t* cache. It is binary incompatible build. Its purpose is to allow authors of third-party libraries to prepare to future breakage.
[snip]
I like your pull request, although I am not sure option 2 is really needed. With your compile-time option, we can remove wstr in early alpha stage (e.g. Python 3.11a1), and get it back again if it breaks too many packages.
The plan is:
1. Add support of the above compile options. Unfortunately I did not have time to do this before feature freeze in 3.9, but maybe make an exception? 2. Make option 2 default. 3. Remove option 1. 4. Enable compiler deprecations for all legacy C API. Currently they are silenced for the C API used internally. 5. Make legacy C API always failing. 6. Remove legacy C API from header files.
There is a long way to steps 5 and 6. I think 3.11 is too early.
Note that compiler deprecation (4) is approved by Łukasz Langa. So Python 3.9 will have compiler deprecation. https://github.com/python/cpython/pull/20878#issuecomment-644830032 On the other hand, PyArg_ParseTuple(AndKeywords) with u/Z format doesn't have any deprecation yet. I'm not sure we can backport the runtime DeprecationWarning to 3.9, because we need to fix Argument Clinic too. (Serhiy's pull request fix the Argument Clinic.) Regards, -- Inada Naoki <songofacandy@gmail.com>