File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -674,6 +674,21 @@ APIs:
674
674
.. versionadded :: 3.3
675
675
676
676
677
+ .. c :function :: int PyUnicode_Resize (PyObject **unicode, Py_ssize_t length);
678
+
679
+ Resize a Unicode object *\* unicode * to the new *length * in code points.
680
+
681
+ Try to resize the string in place (which is usually faster than allocating
682
+ a new string and copying characters), or create a new string.
683
+
684
+ *\*unicode* is modified to point to the new (resized) object and ``0`` is
685
+ returned on success. Otherwise, ``-1`` is returned and an exception is set,
686
+ and *\*unicode* is left untouched.
687
+
688
+ The function doesn't check string content, the result may not be a
689
+ string in canonical representation.
690
+
691
+
677
692
.. c:function:: Py_ssize_t PyUnicode_Fill(PyObject *unicode, Py_ssize_t start, \
678
693
Py_ssize_t length, Py_UCS4 fill_char)
679
694
Original file line number Diff line number Diff line change @@ -2794,6 +2794,10 @@ PyUnicode_CopyCharacters:PyObject*:from:0:
2794
2794
PyUnicode_CopyCharacters:Py_ssize_t:from_start::
2795
2795
PyUnicode_CopyCharacters:Py_ssize_t:how_many::
2796
2796
2797
+ PyUnicode_Resize:int:::
2798
+ PyUnicode_Resize:PyObject**:unicode:0:
2799
+ PyUnicode_Resize:Py_ssize_t:length::
2800
+
2797
2801
PyUnicode_Fill:Py_ssize_t:::
2798
2802
PyUnicode_Fill:PyObject*:unicode:0:
2799
2803
PyUnicode_Fill:Py_ssize_t:start::
You can’t perform that action at this time.
0 commit comments