Hi Inada-san, thank you for adding some comments, but they are not really capturing what I think is missing:
""" Removing these APIs removes ability to use codec without temporary Unicode. Codecs can not encode Unicode buffer directly without temporary Unicode object since Python 3.3. All these APIs creates temporary Unicode object for now. So removing them doesn't reduce any abilities. """ The point is that while the decoders allow going from a C object to a Python object directly, we are missing a way to do the same for the encoders, since the Python 3.3 change in the Unicode internals. At the very least, we should have such APIs for going from wchar_t* to a Python object. The alternatives you provide all require creating an intermediate Python object for this purpose. The APIs you want to remove do that as well, but that's not the point. The point is to expose the codecs' decode mechanism which is available in the C code, but currently not exposed via C APIs, e.g. ucs4lib_utf8_encode(). It would be breaking change, but those APIs in your list could simply be changed from using Py_UNICODE to using whcar_t instead and then interface directly to the internal functions we have for the encoders. That would keep extensions working after a recompile, since Py_UNICODE is already a typedef to wchar_t. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Experts (#1, Feb 01 2021) >>> Python Projects, Coaching and Support ... https://www.egenix.com/ >>> Python Product Development ... https://consulting.egenix.com/ ________________________________________________________________________ ::: We implement business ideas - efficiently in both time and costs ::: eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611 https://www.egenix.com/company/contact/ https://www.malemburg.com/ On 22.01.2021 07:47, Inada Naoki wrote: > Hi, Lemburg. > > I want to send the PEP to SC. > I think I wrote all your points in the PEP. Would you review it? > > Regards, > > On Tue, Aug 4, 2020 at 5:04 PM Inada Naoki <songofaca...@gmail.com> wrote: >> >> On Tue, Aug 4, 2020 at 3:31 PM M.-A. Lemburg <m...@egenix.com> wrote: >>> >>> Hi Inada-san, >>> >>> thanks for attending EuroPython. I won't be back online until >>> next Wednesday. Would it be possible to wait until then to continue >>> the discussion ? >>> >> >> Of course. The PEP is for Python 3.11. We have a lot of time. >> >> Bests, > > -- > Inada Naoki <songofaca...@gmail.com> > _______________________________________________ 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/VT2J6GC7ED4PTUCU5QO6SLL4PAQ6XEKL/ Code of Conduct: http://python.org/psf/codeofconduct/