Hi INADA-san,

This PEP is the result of 2 years of refactoring to *simplify* the
*implementation*. I agree that bytes string is the native type on Unix.
But. On Windows, Unicode is the native type. On Python 3, Unicode is the
native type. One key of the simplified implementation is the unique
PyConfig structure. It means that all platforms have to use the same types.

I love the idea of using only wchar_t* for PyConfig because it makes Python
initialization more reliable. The question of the encoding used to decode
byte strings and any possible decoding error (very unlikely thanks to
surrogateescape) is better defined: it occurs when you set the parameter,
not "later during init".

The PEP adds Py_UnixMain() for most trivial use cases, and
PyConfig_DecodeLocale() and PyConfig_SetArgs() for more advanced cases.

Victor

Le samedi 4 mai 2019, Inada Naoki <songofaca...@gmail.com> a écrit :
> 2019年5月3日(金) 4:59 Victor Stinner <vstin...@redhat.com>:
>>
>> * PyConfig now only uses wchar_t* for strings (unicode): char* (bytes)
>> is no longer used. I had to hack CPython internals for that :-)
>
> I prefer char* to wchar_t* on Unix.  Since UTF-8 dominated Unix world
> in these decades, wchar_t* is less usable on Unix nowadays.
>
> Is it impossible to use just char* on Unix and wchar_t* on Windows?
>
> --
> Inada Naoki  <songofaca...@gmail.com>
>

-- 
Night gathers, and now my watch begins. It shall not end until my death.
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to