Skip to content

Commit 7b1605d

Browse files
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 <noreply@anthropic.com>
1 parent f3a381e commit 7b1605d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Lib/_pyrepl/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def unbracket(s: str, including_content: bool = False) -> str:
9797

9898

9999
def gen_colors(buffer: str) -> Iterator[ColorSpan]:
100-
"""Returns a list of index spans to color using the given color tag.
100+
"""Yield index spans to color using the given color tag.
101101
102102
The input `buffer` should be a valid start of a Python code block, i.e.
103103
it cannot be a block starting in the middle of a multiline string.

0 commit comments

Comments
 (0)