Re: [Python-Dev] cpython: Document PyUnicode_Copy() and PyUnicode_EncodeCodePage()

2011-12-11 Thread Victor Stinner
Le vendredi 9 décembre 2011 20:32:16 Antoine Pitrou a écrit : > ... it's a bit obscure why the function exists. Yeah ok, I marked the function as private: renamed to _PyUnicode_Copy() and I undocumented it. Victor ___ Python-Dev mailing list Python-Dev

Re: [Python-Dev] cpython: Document PyUnicode_Copy() and PyUnicode_EncodeCodePage()

2011-12-11 Thread Antoine Pitrou
Le dimanche 11 décembre 2011 à 23:44 +0100, "Martin v. Löwis" a écrit : > Am 09.12.2011 20:32, schrieb Antoine Pitrou: > > On Fri, 09 Dec 2011 19:51:14 +0100 > > Victor Stinner wrote: > >> On 09/12/2011 01:35, Antoine Pitrou wrote: > >>> On Fri, 09 Dec 2011 00:16:02 +0100 > >>> victor.stinner wro

Re: [Python-Dev] cpython: Document PyUnicode_Copy() and PyUnicode_EncodeCodePage()

2011-12-11 Thread Martin v. Löwis
Am 09.12.2011 20:32, schrieb Antoine Pitrou: > On Fri, 09 Dec 2011 19:51:14 +0100 > Victor Stinner wrote: >> On 09/12/2011 01:35, Antoine Pitrou wrote: >>> On Fri, 09 Dec 2011 00:16:02 +0100 >>> victor.stinner wrote: +.. c:function:: PyObject* PyUnicode_Copy(PyObject *unicode) + >>

Re: [Python-Dev] cpython: Document PyUnicode_Copy() and PyUnicode_EncodeCodePage()

2011-12-11 Thread Martin v. Löwis
Am 09.12.2011 10:12, schrieb Nick Coghlan: > On Fri, Dec 9, 2011 at 6:44 PM, "Martin v. Löwis" wrote: >> Am 09.12.2011 01:35, schrieb Antoine Pitrou: >>> On Fri, 09 Dec 2011 00:16:02 +0100 >>> victor.stinner wrote: +.. c:function:: PyObject* PyUnicode_Copy(PyObject *unicode) +

Re: [Python-Dev] cpython: Document PyUnicode_Copy() and PyUnicode_EncodeCodePage()

2011-12-09 Thread Antoine Pitrou
On Fri, 09 Dec 2011 19:51:14 +0100 Victor Stinner wrote: > On 09/12/2011 01:35, Antoine Pitrou wrote: > > On Fri, 09 Dec 2011 00:16:02 +0100 > > victor.stinner wrote: > >> > >> +.. c:function:: PyObject* PyUnicode_Copy(PyObject *unicode) > >> + > >> + Get a new copy of a Unicode object. > >> +

Re: [Python-Dev] cpython: Document PyUnicode_Copy() and PyUnicode_EncodeCodePage()

2011-12-09 Thread Victor Stinner
On 09/12/2011 01:35, Antoine Pitrou wrote: On Fri, 09 Dec 2011 00:16:02 +0100 victor.stinner wrote: +.. c:function:: PyObject* PyUnicode_Copy(PyObject *unicode) + + Get a new copy of a Unicode object. + + .. versionadded:: 3.3 I'm not sure I understand. Why would you make a copy of an im

Re: [Python-Dev] cpython: Document PyUnicode_Copy() and PyUnicode_EncodeCodePage()

2011-12-09 Thread Barry Warsaw
On Dec 09, 2011, at 07:12 PM, Nick Coghlan wrote: >Isn't it basically just exposing a C level version of the unicode() >builtin's behaviour? While I agree the name could be better (and >PyUnicode_AsExactUnicode would certainly work), why make it private? Don't we already have that in PyObject_Str

Re: [Python-Dev] cpython: Document PyUnicode_Copy() and PyUnicode_EncodeCodePage()

2011-12-09 Thread Nick Coghlan
On Fri, Dec 9, 2011 at 6:44 PM, "Martin v. Löwis" wrote: > Am 09.12.2011 01:35, schrieb Antoine Pitrou: >> On Fri, 09 Dec 2011 00:16:02 +0100 >> victor.stinner wrote: >>> >>> +.. c:function:: PyObject* PyUnicode_Copy(PyObject *unicode) >>> + >>> +   Get a new copy of a Unicode object. >>> + >>> +

Re: [Python-Dev] cpython: Document PyUnicode_Copy() and PyUnicode_EncodeCodePage()

2011-12-09 Thread Martin v. Löwis
Am 09.12.2011 01:35, schrieb Antoine Pitrou: > On Fri, 09 Dec 2011 00:16:02 +0100 > victor.stinner wrote: >> >> +.. c:function:: PyObject* PyUnicode_Copy(PyObject *unicode) >> + >> + Get a new copy of a Unicode object. >> + >> + .. versionadded:: 3.3 > > I'm not sure I understand. Why would

Re: [Python-Dev] cpython: Document PyUnicode_Copy() and PyUnicode_EncodeCodePage()

2011-12-08 Thread Antoine Pitrou
On Fri, 09 Dec 2011 00:16:02 +0100 victor.stinner wrote: > > +.. c:function:: PyObject* PyUnicode_Copy(PyObject *unicode) > + > + Get a new copy of a Unicode object. > + > + .. versionadded:: 3.3 I'm not sure I understand. Why would you make a copy of an immutable object? ___