Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e4ea994

Browse files
author
Victor Stinner
committed
Document PyUnicode_AsUnicodeCopy()
1 parent 4640860 commit e4ea994

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

Doc/c-api/unicode.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,14 @@ APIs:
335335
buffer, *NULL* if *unicode* is not a Unicode object.
336336

337337

338+
.. cfunction:: Py_UNICODE* PyUnicode_AsUnicodeCopy(PyObject *unicode)
339+
340+
Create a copy of a unicode string ending with a nul character. Return *NULL*
341+
and raise a :exc:`MemoryError` exception on memory allocation failure,
342+
otherwise return a new allocated buffer (use :cfunc:`PyMem_Free` to free the
343+
buffer).
344+
345+
338346
.. cfunction:: Py_ssize_t PyUnicode_GetSize(PyObject *unicode)
339347

340348
Return the length of the Unicode object.

0 commit comments

Comments
 (0)