[Python-Dev] _Py_Identifier should support non-ASCII string?
Hi, all. Both of PyUnicdoe_FromString() and _Py_Identifier are supporting UTF-8 for now. We can not change PyUnicode_FromString() for backward compatibility, so we have _PyUnicode_FromASCII instead. But _Py_Identifier is still private. And non-ASCII identifier is not practical. Can we change _PyUnicode_FromId to use _PyUnicode_FromASCII? Regards, -- Inada Naoki ___ Python-Dev mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/[email protected]/message/CHFLUCGEWBGXMBRX2E6OSE3BZ3ZGUNKS/
[Python-Dev] Re: _Py_Identifier should support non-ASCII string?
On 20Jun2019 0205, Inada Naoki wrote: Hi, all. Both of PyUnicdoe_FromString() and _Py_Identifier are supporting UTF-8 for now. We can not change PyUnicode_FromString() for backward compatibility, so we have _PyUnicode_FromASCII instead. But _Py_Identifier is still private. And non-ASCII identifier is not practical. Can we change _PyUnicode_FromId to use _PyUnicode_FromASCII? What benefit would this provide? And why is a non-ASCII identifier not practical? Cheers, Steve ___ Python-Dev mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/[email protected]/message/MTODUH26R6T3TEKYJOGQ2JTOVKPXRRIC/
[Python-Dev] Re: _Py_Identifier should support non-ASCII string?
Le jeu. 20 juin 2019 à 11:15, Inada Naoki a écrit : > Can we change _PyUnicode_FromId to use _PyUnicode_FromASCII? How would a developer detect a mistake (non-ASCII) character? Does _PyUnicode_FromASCII() raise an exception, even in release mode? The function is only called once (that's the whole purpose of the Py_IDENTIFER() API. Is it really worth it? Victor -- Night gathers, and now my watch begins. It shall not end until my death. ___ Python-Dev mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/[email protected]/message/QSLDA5DYMZUWZOAIOVCAEYA45MPUSBB4/
[Python-Dev] Re: Who uses libpython38.a on Windows?
On 14Jun2019 1930, MRAB wrote: I'm able to build the regex module without it; in fact, I believe I've been able to do so since Python 3.5! This is about the only specific feedback I've received (including on Twitter, where most reactions were "I have no idea what file you're talking about"), so I'm going to drop the MinGW lib from 3.8 and update the docs with instruction. Cheers, Steve ___ Python-Dev mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/[email protected]/message/GZVN2FIFMTSW7CWQHFW2PWLNFCWHC2Y7/
[Python-Dev] Re: _Py_Identifier should support non-ASCII string?
This change would break two lovely functions I wrote this week. On Thu, Jun 20, 2019, 12:35 PM Steve Dower wrote: > On 20Jun2019 0205, Inada Naoki wrote: > > Hi, all. > > > > Both of PyUnicdoe_FromString() and _Py_Identifier are > > supporting UTF-8 for now. We can not change PyUnicode_FromString() > > for backward compatibility, > > so we have _PyUnicode_FromASCII instead. > > > > But _Py_Identifier is still private. And non-ASCII identifier > > is not practical. > > Can we change _PyUnicode_FromId to use _PyUnicode_FromASCII? > > What benefit would this provide? And why is a non-ASCII identifier not > practical? > > Cheers, > Steve > ___ > Python-Dev mailing list -- [email protected] > To unsubscribe send an email to [email protected] > https://mail.python.org/mailman3/lists/python-dev.python.org/ > Message archived at > https://mail.python.org/archives/list/[email protected]/message/MTODUH26R6T3TEKYJOGQ2JTOVKPXRRIC/ > ___ Python-Dev mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/[email protected]/message/6BMPSO2GMOPYQWS4TUN3MCRUVJRGX4HO/
[Python-Dev] Re: _Py_Identifier should support non-ASCII string?
On Fri, Jun 21, 2019 at 1:23 AM Steve Dower wrote: > > What benefit would this provide? It is faster, of course. The whole benefit will be not significant for now. But I'm thinking of making _Py_Identifier public (CPython API) in the future. If we make it public, breaking change is hard after that. So I want to confirm it's intended that _Py_Identifier support non-ASCII. If it's not intended, more strict equals to more possibility of optimization in the future. > And why is a non-ASCII identifier not > practical? > Hm, I might wrong about the nuance of the word "practical". I meant it's very uncommon. It's because: * While we allow non-ASCII identifier in Python, we don't use them in core. * Most usage of _Py_Identifier creates C variable named like C PyId_foo. * There is _Py_static_string which doesn't create variable named like PyId_foo, but all usage in CPython uses ASCII only, and _Py_Identifier is still private. -- Inada Naoki ___ Python-Dev mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/[email protected]/message/PTJEUFDKEIUSUFUCEQWWVRCERVQENQFA/
[Python-Dev] Re: _Py_Identifier should support non-ASCII string?
On Fri, Jun 21, 2019 at 1:28 AM Victor Stinner wrote: > > Le jeu. 20 juin 2019 à 11:15, Inada Naoki a écrit : > > Can we change _PyUnicode_FromId to use _PyUnicode_FromASCII? > > How would a developer detect a mistake (non-ASCII) character? Does > _PyUnicode_FromASCII() raise an exception, even in release mode? No. That's one of the reasons why _PyUnicode_FromASCII is much faster than PyUnicode_FromString(). > > The function is only called once (that's the whole purpose of the > Py_IDENTIFER() API. Is it really worth it? > Maybe no, at least for now. I just want to ask is it really worth it to support non-ASCII identifier, before we make it public or 3rd parties start using it widely. -- Inada Naoki ___ Python-Dev mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/[email protected]/message/GCC5YDIPAIUT67EVKLGJ3INA24FRHNR5/
[Python-Dev] Re: _Py_Identifier should support non-ASCII string?
On Fri, Jun 21, 2019 at 6:55 AM David Mertz wrote: > > This change would break two lovely functions I wrote this week. > Are your lovely functions in CPython, or in your project? _Py_Identifier is still private and undocumented. But I expect someone start using it outside of CPython. So I wanted to discuss we really need to support non-ASCII before that. But it seems I was late already. -- Inada Naoki ___ Python-Dev mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/[email protected]/message/MBUULS7DR2RUH26TIWAYP67YQNQJGKH2/
[Python-Dev] Re: _Py_Identifier should support non-ASCII string?
Ok. Good point. I used Unicode identifiers in my own project, not in CPython. Some Greek letters that represent common mathematical concepts. On Thu, Jun 20, 2019, 11:27 PM Inada Naoki wrote: > On Fri, Jun 21, 2019 at 6:55 AM David Mertz wrote: > > > > This change would break two lovely functions I wrote this week. > > > > Are your lovely functions in CPython, or in your project? > > _Py_Identifier is still private and undocumented. > But I expect someone start using it outside of CPython. > So I wanted to discuss we really need to support non-ASCII before that. > > But it seems I was late already. > > -- > Inada Naoki > ___ Python-Dev mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/[email protected]/message/PCTTCDXGK6ZT633DPOS6YTPJVQLZJO5C/
