Skip to content

Commit dc92bcb

Browse files
Add PyUnicode_Resize doc
1 parent f3d877a commit dc92bcb

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

Doc/c-api/unicode.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -730,6 +730,19 @@ APIs:
730730
.. versionadded:: 3.3
731731
732732
733+
.. c:function:: int PyUnicode_Resize(PyObject **p_unicode, Py_ssize_t length)
734+
735+
Resize a Unicode object to the new *length* in code points. ``*p_unicode``
736+
must point to a strong reference to a new, unshared Unicode object.
737+
738+
The string must not have been “used” yet.
739+
See :c:func:`PyUnicode_New` for details.
740+
741+
Return ``0`` on success, or ``-1`` on error with an exception set.
742+
743+
.. versionadded:: 2.7
744+
745+
733746
.. c:function:: Py_UCS4* PyUnicode_AsUCS4(PyObject *unicode, Py_UCS4 *buffer, \
734747
Py_ssize_t buflen, int copy_null)
735748

Doc/data/refcounts.dat

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2659,6 +2659,10 @@ PyUnicode_Partition:PyObject*::+1:
26592659
PyUnicode_Partition:PyObject*:unicode:0:
26602660
PyUnicode_Partition:PyObject*:sep:0:
26612661

2662+
PyUnicode_Resize:int:::
2663+
PyUnicode_Resize:PyObject*:p_unicode:0:
2664+
PyUnicode_Resize:Py_ssize_t:length::
2665+
26622666
PyUnicode_RPartition:PyObject*::+1:
26632667
PyUnicode_RPartition:PyObject*:unicode:0:
26642668
PyUnicode_RPartition:PyObject*:sep:0:

0 commit comments

Comments
 (0)