Skip to content

Commit 655ae54

Browse files
vstinnersrinivasreddy
authored andcommitted
pythongh-119182: Complete PyUnicodeWriter documentation (python#127607)
1 parent 1523b9d commit 655ae54

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Doc/c-api/unicode.rst

+9
Original file line numberDiff line numberDiff line change
@@ -1588,6 +1588,11 @@ object.
15881588
15891589
Create a Unicode writer instance.
15901590
1591+
*length* must be greater than or equal to ``0``.
1592+
1593+
If *length* is greater than ``0``, preallocate an internal buffer of
1594+
*length* characters.
1595+
15911596
Set an exception and return ``NULL`` on error.
15921597
15931598
.. c:function:: PyObject* PyUnicodeWriter_Finish(PyUnicodeWriter *writer)
@@ -1596,12 +1601,16 @@ object.
15961601
15971602
Set an exception and return ``NULL`` on error.
15981603
1604+
The writer instance is invalid after this call.
1605+
15991606
.. c:function:: void PyUnicodeWriter_Discard(PyUnicodeWriter *writer)
16001607
16011608
Discard the internal Unicode buffer and destroy the writer instance.
16021609
16031610
If *writer* is ``NULL``, no operation is performed.
16041611
1612+
The writer instance is invalid after this call.
1613+
16051614
.. c:function:: int PyUnicodeWriter_WriteChar(PyUnicodeWriter *writer, Py_UCS4 ch)
16061615
16071616
Write the single Unicode character *ch* into *writer*.

0 commit comments

Comments
 (0)