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

Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Documentation
  • Loading branch information
vstinner committed Feb 18, 2025
commit 18ec24db18435e39ce166bedace0a63d64627875
7 changes: 6 additions & 1 deletion Doc/c-api/bytes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,9 @@ PyBytesWriter

Create a :c:type:`PyBytesWriter` to write *alloc* bytes.

If *alloc* is greater than zero, allocate *alloc* bytes for the returned
buffer.

On success, return non-``NULL`` buffer where bytes can be written.
On error, set an exception and return ``NULL``.

Expand All @@ -259,7 +262,9 @@ PyBytesWriter

.. c:function:: void* PyBytesWriter_Extend(PyBytesWriter *writer, void *buf, Py_ssize_t extend)

Extend the buffer by *extend* bytes.
Add *extend* bytes to the buffer: allocate *extend* bytes in addition to
bytes already allocated by previous :c:func:`PyBytesWriter_Create` and
:c:func:`PyBytesWriter_Extend` calls.

On success, return non-``NULL`` buffer where bytes can be written.
On error, set an exception and return ``NULL``.
Expand Down