https://github.com/python/cpython/commit/fd3c510827d5bc0f92571754ee7495078fc60086 commit: fd3c510827d5bc0f92571754ee7495078fc60086 branch: 3.15 author: Miss Islington (bot) <[email protected]> committer: ZeroIntensity <[email protected]> date: 2026-06-18T17:39:20Z summary:
[3.15] gh-146353: Document `PyBytesWriter_GetData` pointer validity (GH-151418) (GH-151664) gh-146353: Document `PyBytesWriter_GetData` pointer validity (GH-151418) (cherry picked from commit e99b319682fe984074e32f52354dbec23ded4d0a) Co-authored-by: Harjoth Khara <[email protected]> files: M Doc/c-api/bytes.rst diff --git a/Doc/c-api/bytes.rst b/Doc/c-api/bytes.rst index f56bcd6333a37d..fa77d3d38ff89f 100644 --- a/Doc/c-api/bytes.rst +++ b/Doc/c-api/bytes.rst @@ -384,14 +384,18 @@ Getters Get the writer size. + The function does not invalidate pointers returned by + :c:func:`PyBytesWriter_GetData`. + The function cannot fail. .. c:function:: void* PyBytesWriter_GetData(PyBytesWriter *writer) Get the writer data: start of the internal buffer. - The pointer is valid until :c:func:`PyBytesWriter_Finish` or - :c:func:`PyBytesWriter_Discard` is called on *writer*. + The pointer remains valid until a :c:type:`PyBytesWriter` function other + than :c:func:`PyBytesWriter_GetData` or :c:func:`PyBytesWriter_GetSize` is + called on *writer*. The function cannot fail. _______________________________________________ Python-checkins mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3//lists/python-checkins.python.org Member address: [email protected]
