Victor Stinner wrote:
On Mon, May 16, 2022 at 11:40 AM dw-git@d-woods.co.uk wrote:
Cython used the private _PyUnicodeWriter API (and stopped using it on Py3.11 when it was hidden more thoroughly) I'm not aware of any change in the the private _PyUnicodeWriter API in Python 3.11.
It was _PyFloat_FormatAdvancedWriter and _PyLong_FormatAdvancedWriter that got moved internally to somewhere Cython couldn't easily get them I think. (https://github.com/python/cpython/commit/0a883a76cda8205023c52211968bcf87bd4... and https://github.com/python/cpython/commit/5f09bb021a2862ba89c3ecb53e7e6e95a9e...). Obviously it would be possible to include the internal headers and re-enable it though - just turning it off was the quickest way to get it working at the time though
Is it just that Cython no longer wants to use private APIs?
No such luck I'm afraid! The current policy is something like: if possible we should have a back-up option to avoid the private API, ideally controlled by a C define. I think that's a fairly good compromise - it lets Cython benefit from the internal APIs but provides an easy fix if they change. Obviously that policy isn't applied perfectly yet...