summaryrefslogtreecommitdiffstats
path: root/Doc/c-api
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2012-01-03 23:33:50 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2012-01-03 23:33:50 (GMT)
commit3fe553160c785f76ca908500a7531fceb2176203 (patch)
tree92adb3edbe5e192bc48bf8b69a4c234f4d1f27b6 /Doc/c-api
parent332503db07ab5f8c2dea301a7ec9b8f7d4f1152f (diff)
downloadcpython-3fe553160c785f76ca908500a7531fceb2176203.zip
cpython-3fe553160c785f76ca908500a7531fceb2176203.tar.gz
cpython-3fe553160c785f76ca908500a7531fceb2176203.tar.bz2
Add a new PyUnicode_Fill() function
It is faster than the unicode_fill() function which was implemented in formatter_unicode.c.
Diffstat (limited to 'Doc/c-api')
-rw-r--r--Doc/c-api/unicode.rst15
1 files changed, 15 insertions, 0 deletions
diff --git a/Doc/c-api/unicode.rst b/Doc/c-api/unicode.rst
index 43e3d2f..3a8b38b 100644
--- a/Doc/c-api/unicode.rst
+++ b/Doc/c-api/unicode.rst
@@ -564,6 +564,21 @@ APIs:
.. versionadded:: 3.3
+.. c:function:: int PyUnicode_Fill(PyObject *unicode, Py_ssize_t start, \
+ Py_ssize_t length, Py_UCS4 fill_char)
+
+ Fill a string with a character: write *fill_char* into
+ ``unicode[start:start+length]``.
+
+ Fail if *fill_char* is bigger than the string maximum character, or if the
+ string has more than 1 reference.
+
+ Return the number of written character, or return ``-1`` and raise an
+ exception on error.
+
+ .. versionadded:: 3.3
+
+
.. c:function:: int PyUnicode_WriteChar(PyObject *unicode, Py_ssize_t index, \
Py_UCS4 character)