From 7b1605d46f06ebe7ef9c51da8e3793eea067a76f Mon Sep 17 00:00:00 2001 From: Anandesh Sharma Date: Fri, 27 Feb 2026 04:05:31 +0530 Subject: [PATCH] Fix gen_colors docstring: function yields, not returns a list The gen_colors function is a generator (uses yield) with return type Iterator[ColorSpan], but its docstring incorrectly stated "Returns a list of index spans". Updated to "Yield index spans" to accurately reflect the function's behavior. Co-Authored-By: Claude Opus 4.6 --- Lib/_pyrepl/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/_pyrepl/utils.py b/Lib/_pyrepl/utils.py index 25d7ac1bd0b14e..8a1f48ae776bf5 100644 --- a/Lib/_pyrepl/utils.py +++ b/Lib/_pyrepl/utils.py @@ -97,7 +97,7 @@ def unbracket(s: str, including_content: bool = False) -> str: def gen_colors(buffer: str) -> Iterator[ColorSpan]: - """Returns a list of index spans to color using the given color tag. + """Yield index spans to color using the given color tag. The input `buffer` should be a valid start of a Python code block, i.e. it cannot be a block starting in the middle of a multiline string.