From 58e3b04ac5ac1b6e27fe77800fde60ad133bdbef Mon Sep 17 00:00:00 2001 From: John Marshall Date: Mon, 16 Nov 2026 23:45:41 +1300 Subject: [PATCH 1/3] Doc: Clarify that print(..., flush=True) flushes *after* printing --- Doc/builtins/functions.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Doc/builtins/functions.rst b/Doc/builtins/functions.rst index 717efe50c130744..edd8b81257ad3e5 100644 --- a/Doc/builtins/functions.rst +++ b/Doc/builtins/functions.rst @@ -1736,7 +1736,8 @@ are always available. They are listed here in alphabetical order. binary mode file objects. For these, use ``file.write(...)`` instead. Output buffering is usually determined by *file*. - However, if *flush* is true, the stream is forcibly flushed. + However, if *flush* is true, the stream is forcibly flushed after the *objects* + have been printed. .. versionchanged:: 3.3 From cf0ce4520a46ae777546393698117349fef6934d Mon Sep 17 00:00:00 2001 From: John Marshall Date: Mon, 16 Nov 2026 23:54:02 +1300 Subject: [PATCH 2/3] Doc: PyByteArray_FromStringAndSize(NULL, len) returns uninitialized contents --- Doc/c-api/bytearray.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/Doc/c-api/bytearray.rst b/Doc/c-api/bytearray.rst index 8f3cb2d63cb3c82..a559d0ca23815f2 100644 --- a/Doc/c-api/bytearray.rst +++ b/Doc/c-api/bytearray.rst @@ -58,6 +58,7 @@ Direct API functions .. c:function:: PyObject* PyByteArray_FromStringAndSize(const char *string, Py_ssize_t len) Create a new bytearray object from *string* and its length, *len*. + If *string* is ``NULL``, the contents of the bytearray object are uninitialized. On failure, return ``NULL`` with an exception set. From 1e061d0df1e3492fe0edc81d5092ca3a3c5996f5 Mon Sep 17 00:00:00 2001 From: John Marshall Date: Mon, 16 Nov 2026 23:55:24 +1300 Subject: [PATCH 3/3] Doc: Minor word choice improvements --- Doc/library/__main__.rst | 2 +- Doc/reference/lexical_analysis.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/__main__.rst b/Doc/library/__main__.rst index 36b884f975804fa..ced619b2eec0b1c 100644 --- a/Doc/library/__main__.rst +++ b/Doc/library/__main__.rst @@ -241,7 +241,7 @@ Idiomatic Usage ^^^^^^^^^^^^^^^ The content of ``__main__.py`` typically isn't fenced with an -``if __name__ == '__main__'`` block. Instead, those files are kept +``if __name__ == '__main__'`` block. Instead, these files are kept short and import functions to execute from other modules. Those other modules can then be easily unit-tested and are properly reusable. diff --git a/Doc/reference/lexical_analysis.rst b/Doc/reference/lexical_analysis.rst index 6f7f352db3c4383..9a06a4f6f7e8bb7 100644 --- a/Doc/reference/lexical_analysis.rst +++ b/Doc/reference/lexical_analysis.rst @@ -278,7 +278,7 @@ backslashes; the whitespace up to the first backslash determines the indentation. Indentation is rejected as inconsistent if a source file mixes tabs and spaces -in a way that makes the meaning dependent on the worth of a tab in spaces; a +in a way that makes the meaning dependent on the width of a tab in spaces; a :exc:`TabError` is raised in that case. **Cross-platform compatibility note:** because of the nature of text editors on