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 don't have to free the memory, it will be done when the Unicode
> > > string will be destroyed (by Py_DECREF).
> > 
> > But this is almost the same as PyUnicode_AsWideCharString, right?
> 
> You have to free the memory for PyUnicode_AsWideCharString().

That's why I said "almost".

I don't think it's a good idea to add this function, for two reasons:

- the unicode API is already big enough, we don't need redundant
  functions with differing refcount behaviours

- the internal wchar_t representation is certainly meant to disappear
  in the long term; adding an API which *relies* on that representation
  is silly, especially after we deliberately deprecated the Py_UNICODE
  APIs

Regards

Antoine.


_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to