Skip to content

Commit 4360787

Browse files
committed
gh-146353: Document PyBytesWriter_GetData pointer validity
1 parent f4f1020 commit 4360787

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

Doc/c-api/bytes.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -384,14 +384,18 @@ Getters
384384
385385
Get the writer size.
386386
387+
The function does not invalidate pointers returned by
388+
:c:func:`PyBytesWriter_GetData`.
389+
387390
The function cannot fail.
388391
389392
.. c:function:: void* PyBytesWriter_GetData(PyBytesWriter *writer)
390393
391394
Get the writer data: start of the internal buffer.
392395
393-
The pointer is valid until :c:func:`PyBytesWriter_Finish` or
394-
:c:func:`PyBytesWriter_Discard` is called on *writer*.
396+
The pointer remains valid until a :c:type:`PyBytesWriter` function other
397+
than :c:func:`PyBytesWriter_GetData` or :c:func:`PyBytesWriter_GetSize` is
398+
called on *writer*.
395399
396400
The function cannot fail.
397401

0 commit comments

Comments
 (0)