A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2010-September/103437.html below:

[Python-Dev] r84430 - in python/branches/py3k: Include/unicodeobject.h Objects/unicodeobject.c

[Python-Dev] r84430 - in python/branches/py3k: Include/unicodeobject.h Objects/unicodeobject.c [Python-Dev] r84430 - in python/branches/py3k: Include/unicodeobject.h Objects/unicodeobject.cVictor Stinner victor.stinner at haypocalc.com
Fri Sep 3 18:24:56 CEST 2010
Le vendredi 03 septembre 2010 10:01:12, vous avez écrit :
> > (...)
> > About PyUnicode_strdup() (PyUnicode_AsUnicodeCopy): I don't know. It is
> > possible to rewrite it in few lines. Why don't you want to add them to
> > the public API? For my work, it doesn't matter if it's public or not.
> > This function uses PyMem_xxx API, I don't know if a third part library
> > would like to rely on PyMem_xxx.
> 
> This will have to be documented (see PEP 384 for some reasoning on
> malloc() use in DLLs).

It is already documented in unicodeobject.h.

> Other than that, ok, let's have them.

Ok.

r84455 renames PyUnicode_strdup() to PyUnicode_AsUnicodeCopy(), and r84456 
document it:

----------
.. cfunction:: Py_UNICODE* PyUnicode_AsUnicodeCopy(PyObject *unicode)

   Create a copy of a unicode string ending with a nul character. Return 
*NULL*
   and raise a :exc:`MemoryError` exception on memory allocation failure,
   otherwise return a new allocated buffer (use :cfunc:`PyMem_Free` to free the
   buffer).
----------

Thanks all for your review and advices ;-)

-- 
Victor Stinner
http://www.haypocalc.com/
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4