Inada Naoki <songofaca...@gmail.com> added the comment:

> 1a. Declare both functions equally acceptable. Remove comments claiming that 
> PyUnicode_AsUTF8AndSize() should be avoided.
>
> 1b. 1a, and change the implementation of PyUnicode_AsUTF8AndSize() to avoid 
> allocating the string twice if it needs to be materialized, so that 
> PyUnicode_AsUTF8AndSize() is never significantly slower than 
> PyUnicode_AsUTF8String().

I think 1b is the best approach.

PyUnicode_AsUTF8AndSize() is optimized already. See GH-18327.
And it becomes limited API. See bpo-41784.

So we should just remove the outdated comments.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue35295>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to