diff --git a/stdlib/tokenize.pyi b/stdlib/tokenize.pyi index 5f022844cea8..2655f2f0266a 100644 --- a/stdlib/tokenize.pyi +++ b/stdlib/tokenize.pyi @@ -130,9 +130,8 @@ class Untokenizer: if sys.version_info >= (3, 12): def escape_brackets(self, token: str) -> str: ... -# the docstring says "returns bytes" but is incorrect -- -# if the ENCODING token is missing, it skips the encode -def untokenize(iterable: Iterable[_Token]) -> str | Any: ... # str in most use cases +# Returns str, unless the ENCODING token is present, in which case it returns bytes. +def untokenize(iterable: Iterable[_Token]) -> str | Any: ... def detect_encoding(readline: Callable[[], bytes | bytearray]) -> tuple[str, Sequence[bytes]]: ... def tokenize(readline: Callable[[], bytes | bytearray]) -> Generator[TokenInfo, None, None]: ... def generate_tokens(readline: Callable[[], str]) -> Generator[TokenInfo, None, None]: ...