[Python-checkins] r84456 - python/branches/py3k/Doc/c-api/unicode.rst
victor.stinner
python-checkins at python.org
Fri Sep 3 18:23:29 CEST 2010
Author: victor.stinner
Date: Fri Sep 3 18:23:29 2010
New Revision: 84456
Log:
Document PyUnicode_AsUnicodeCopy()
Modified:
python/branches/py3k/Doc/c-api/unicode.rst
Modified: python/branches/py3k/Doc/c-api/unicode.rst
==============================================================================
--- python/branches/py3k/Doc/c-api/unicode.rst (original)
+++ python/branches/py3k/Doc/c-api/unicode.rst Fri Sep 3 18:23:29 2010
@@ -335,6 +335,14 @@
buffer, *NULL* if *unicode* is not a Unicode object.
+.. 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).
+
+
.. cfunction:: Py_ssize_t PyUnicode_GetSize(PyObject *unicode)
Return the length of the Unicode object.
More information about the Python-checkins
mailing list