Author serhiy.storchaka
Recipients ezio.melotti, inada.naoki, lemburg, scoder, serhiy.storchaka, vstinner
Date 2019-03-19.10:45:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1552992321.66.0.698730818541.issue36346@roundup.psfhosted.org>
In-reply-to
Content
I wrote this PR just to see how much code should be changed after removing the wchar_t cache, and what be performance impact. Get it, experiment with it, run tests and benchmarks. I think we could set USE_UNICODE_WCHAR_CACHE to 0 by default. If this will cause significant troubles, it is easy to set it to 1.

I am going to add configure options for switching these options. On Windows you will still need to edit the config file manually.

> I'm not sure we need two options.
> Does USE_UNICODE_WCHAR_CACHE=0 really helps preparing to the removal?

Currently some of the legacy functions are not decorated with Py_DEPRECATED, because this would cause compiler warnings in the code that uses these functions. If USE_UNICODE_WCHAR_CACHE is 0, these functions will no longer used, so we can add compiler warnings for them.

> I don't think changing sequence iteration to list iteration only
> is something that should be hidden in a wchar_t removal PR.

getenvironment() is the function that has been rewritten to the new API without preserving the old variant. Since the code was rewritten so much, I performed some code clean up. PyMapping_Keys() and PyMapping_Values() always return a list now, so that using the PySequence_Fast API is superfluous. They could return a tuple in the past, but this provoked bugs because the user code used PyList API for it.

I'll open a separate issue for this.

> Since these C macros are public, should they be named PY_* ?

CPython configuration macros (like HAVE_ACOSH or USE_COMPUTED_GOTOS) do not have the PY_ prefix.
History
Date User Action Args
2019-03-19 10:45:21serhiy.storchakasetrecipients: + serhiy.storchaka, lemburg, scoder, vstinner, ezio.melotti, inada.naoki
2019-03-19 10:45:21serhiy.storchakasetmessageid: <1552992321.66.0.698730818541.issue36346@roundup.psfhosted.org>
2019-03-19 10:45:21serhiy.storchakalinkissue36346 messages
2019-03-19 10:45:21serhiy.storchakacreate