On Fri, Jan 26, 2018, at 09:18, M.-A. Lemburg wrote:
> Is there a way to call an API which fixes the setting
> (a public version of unicode_adjust_maxchar()) ?
> 
> Without this, how would an extension be able to provide a
> correct value upfront without knowing the content ?

It obviously has to know the content before it can finally return the string 
(or pass it to any other function, etc), because strings are immutable. Why not 
then do all the intermediate work in an array of int32's (or perhaps a UCS-4 
PyUnicode to be returned only if needed), then afterward scan and build the 
string?
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to