Skip to content

Commit 9ae141e

Browse files
committed
gh-156939: Document that PyBytesObject ends with a NUL byte
1 parent 9398655 commit 9ae141e

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Doc/c-api/bytes.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ Bytes Objects
88
These functions raise :exc:`TypeError` when expecting a bytes parameter and
99
called with a non-bytes parameter.
1010

11+
.. impl-detail::
12+
A :c:type:`PyBytesObject` allocates an extra trailing NUL byte for
13+
compatibility with NUL terminated C strings.
14+
1115
.. index:: pair: object; bytes
1216

1317

0 commit comments

Comments
 (0)