Victor Stinner wrote: > My proposed API targets Python 3.12, it's too late for Python 3.11. > Maybe for Python 3.11, it's ok to add back private > _PyFloat_FormatAdvancedWriter and _PyLong_FormatAdvancedWriter > functions to the public C API to restore Cython performance.
I think at this stage they should be left where they are. I can see why they were made private > If a public API is added to "build a string", maybe it would > make sense to add these "advanced formatter" functions to the public C > API? I think that the Cython is most likely to use a public string builder API for string formatting (for example fstrings). To me that suggests it'd be useful for a public API to include number formatting. Uses like concatenating strings in a loop are a little harder to optimize just because it'd be hard to identify when to switch a variable from stringbuilder to string seemlessly and invisibly to a user. So we'd probably only use it for single expressions (of which formatting is the most obvious) _______________________________________________ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/HCEUV7BKAG4RBWFEX4FOWJKL3OKHKDT2/ Code of Conduct: http://python.org/psf/codeofconduct/