[Python-Dev] Chose a name for a get unicode as wide character, borrowed reference function

2011-11-21 Thread Victor Stinner
Hi, With the PEP 393, the Py_UNICODE is now deprecated and scheduled for removal in Python 4. PyUnicode_AsUnicode() and PyUnicode_AsUnicodeAndSize() functions are still commonly used on Windows to get the string as wchar_t* without having to care of freeing the memory: it's a borrowed

Re: [Python-Dev] Chose a name for a get unicode as wide character, borrowed reference function

2011-11-21 Thread Antoine Pitrou
On Mon, 21 Nov 2011 12:53:17 +0100 Victor Stinner victor.stin...@haypocalc.com wrote: I would like to add a new PyUnicode_AsWideChar() function which would return the borrowed reference, exactly as PyUnicode_AsUnicode(). The problem is that PyUnicode_AsWideChar already exists in Python 3.2,

Re: [Python-Dev] Chose a name for a get unicode as wide character, borrowed reference function

2011-11-21 Thread Victor Stinner
Le Lundi 21 Novembre 2011 16:04:06 Antoine Pitrou a écrit : On Mon, 21 Nov 2011 12:53:17 +0100 Victor Stinner victor.stin...@haypocalc.com wrote: I would like to add a new PyUnicode_AsWideChar() function which would return the borrowed reference, exactly as PyUnicode_AsUnicode(). The

Re: [Python-Dev] Chose a name for a get unicode as wide character, borrowed reference function

2011-11-21 Thread Antoine Pitrou
On Mon, 21 Nov 2011 16:53:10 +0100 Victor Stinner victor.stin...@haypocalc.com wrote: Le Lundi 21 Novembre 2011 16:04:06 Antoine Pitrou a écrit : On Mon, 21 Nov 2011 12:53:17 +0100 Victor Stinner victor.stin...@haypocalc.com wrote: I would like to add a new PyUnicode_AsWideChar()

Re: [Python-Dev] Chose a name for a get unicode as wide character, borrowed reference function

2011-11-21 Thread Victor Stinner
Le Lundi 21 Novembre 2011 16:55:05 Antoine Pitrou a écrit : I want to rename PyUnicode_AsUnicode() and change its result type (Py_UNICODE* = wchar_t*). The result will be a borrowed reference, ie. you don't have to free the memory, it will be done when the Unicode string will be destroyed

Re: [Python-Dev] Chose a name for a get unicode as wide character, borrowed reference function

2011-11-21 Thread Antoine Pitrou
On Mon, 21 Nov 2011 18:02:36 +0100 Victor Stinner victor.stin...@haypocalc.com wrote: Le Lundi 21 Novembre 2011 16:55:05 Antoine Pitrou a écrit : I want to rename PyUnicode_AsUnicode() and change its result type (Py_UNICODE* = wchar_t*). The result will be a borrowed reference, ie. you