Skip to content

Commit c26246e

Browse files
committed
Implementation
1 parent f536c9e commit c26246e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

peps/pep-0782.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,11 @@ The implementation allocates internally a :class:`bytes` object, so
277277
:c:func:`PyBytesWriter_Finish` just returns the object without having
278278
to copy memory.
279279
280+
For strings up to 256 bytes, a small internal raw buffer of bytes is
281+
used. It avoids having to resize a :class:`bytes` object which is
282+
inefficient. At the end, :c:func:`PyBytesWriter_Finish` creates the
283+
:class:`bytes` object from this small buffer.
284+
280285
281286
Backwards Compatibility
282287
=======================

0 commit comments

Comments
 (0)