From fa317146c979cb97d32723aa3beea2c5b1899860 Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Thu, 10 Jul 2025 20:45:34 -0700 Subject: [PATCH 1/2] Fix a minor typo --- peps/pep-0782.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/peps/pep-0782.rst b/peps/pep-0782.rst index 3114bc2fcd7..a7af2073182 100644 --- a/peps/pep-0782.rst +++ b/peps/pep-0782.rst @@ -54,7 +54,7 @@ strategy is to allocate a short buffer and extend it (to the exact size) each time a larger write is needed. This strategy is inefficient because it requires to enlarge the buffer -multiple timess. It's more efficient to overallocate the buffer the +multiple times. It's more efficient to overallocate the buffer the first time that a larger write is needed. It reduces the number of expensive ``realloc()`` operations which can imply a memory copy. From 0af4cd8fc1dfeac5919f3c4f6a578a9866a6ff7d Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Thu, 10 Jul 2025 20:50:30 -0700 Subject: [PATCH 2/2] Update peps/pep-0782.rst Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> --- peps/pep-0782.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/peps/pep-0782.rst b/peps/pep-0782.rst index a7af2073182..32a46ee3f6a 100644 --- a/peps/pep-0782.rst +++ b/peps/pep-0782.rst @@ -53,7 +53,7 @@ When creating a bytes string and the output size is unknown, one strategy is to allocate a short buffer and extend it (to the exact size) each time a larger write is needed. -This strategy is inefficient because it requires to enlarge the buffer +This strategy is inefficient because it requires enlarging the buffer multiple times. It's more efficient to overallocate the buffer the first time that a larger write is needed. It reduces the number of expensive ``realloc()`` operations which can imply a memory copy.