msg101959 - (view) |
Author: Arnaud Fontaine (arnau) |
Date: 2010-03-30 23:26 |
For example, PyUnicode_FromFormat() does not specify the return value but it does not seem to be only one. I only have a basic knowledge of Python C/API, so I am not sure whether it is meaningful. |
|
|
msg101983 - (view) |
Author: Ezio Melotti (ezio.melotti) *  |
Date: 2010-03-31 06:48 |
if you are referring to http://docs.python.org/dev/py3k/c-api/unicode.html#PyUnicode_FromFormat the return type is a PyObject. See also http://docs.python.org/dev/py3k/c-api/structures.html#PyObject |
|
|
msg101984 - (view) |
Author: Arnaud Fontaine (arnau) |
Date: 2010-03-31 07:16 |
I meant whether it returns a new reference or not. For instance, documentation for PyUnicode_FromObject() and PyUnicode_AsWideChar() states that a new reference is returned, but this is most specified for most functions in Unicode Object (at least). |
|
|
msg101985 - (view) |
Author: Arnaud Fontaine (arnau) |
Date: 2010-03-31 07:17 |
I meant whether it returns a new reference or not. For instance, documentation for PyUnicode_FromObject() and PyUnicode_AsWideChar() states that a new reference is returned, but this is not specified for most functions in Unicode Object (at least). |
|
|
msg102025 - (view) |
Author: Marc-Andre Lemburg (lemburg) *  |
Date: 2010-03-31 18:14 |
Arnaud Fontaine wrote: > > Arnaud Fontaine <arnau@debian.org> added the comment: > > I meant whether it returns a new reference or not. For instance, documentation for PyUnicode_FromObject() and PyUnicode_AsWideChar() states that a new reference is returned, but this is not specified for most functions in Unicode Object (at least). Patches are welcome ! FWIW: Unless otherwise noted, all Unicode APIs that return a PyObject* give you a new reference. |
|
|
msg102129 - (view) |
Author: Georg Brandl (georg.brandl) *  |
Date: 2010-04-01 20:10 |
I'd like to add that a patch would need to modify Doc/data/refcounts.dat, not the .rst files. |
|
|
msg132834 - (view) |
Author: Torsten Becker (torsten.becker) |
Date: 2011-04-03 10:51 |
Hi, I read through unicodeobject.c and added the (IMO) proper reference counts to the missing functions. I attached a first patch which adds this to Doc/data/refcounts.dat. The patch also fixes 2 minor glitches in Doc/c-api/unicode.rst, PyUnicode_DecodeMBCSStateful stated int instead of Py_ssize_t for it's arguments and PyUnicode_FromString had it's return value wrongly formated. |
|
|
msg362710 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2020-02-26 18:46 |
Sorry, we missed this issue. refcounts.dat was updated in other issues. |
|
|