]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-82663: Clarify `codecs.iterdecode/encode` docs (GH-136497) (#136512)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 10 Jul 2025 15:41:27 +0000 (17:41 +0200)
committerGitHub <noreply@github.com>
Thu, 10 Jul 2025 15:41:27 +0000 (17:41 +0200)
gh-82663: Clarify `codecs.iterdecode/encode` docs (GH-136497)

Closes GH-82663
(cherry picked from commit 4b41b2043b110a38616ff86ddb3f065ae7f15c3e)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Doc/library/codecs.rst

index 437289c880c852e868dfcd6f0bc442f4acd1be02..a8f8c884d218a6a3e299509c46d5870d6d891e00 100644 (file)
@@ -239,8 +239,8 @@ wider range of codecs when working with binary files:
 .. function:: iterencode(iterator, encoding, errors='strict', **kwargs)
 
    Uses an incremental encoder to iteratively encode the input provided by
-   *iterator*. This function is a :term:`generator`.
-   The *errors* argument (as well as any
+   *iterator*. *iterator* must yield :class:`str` objects.
+   This function is a :term:`generator`. The *errors* argument (as well as any
    other keyword argument) is passed through to the incremental encoder.
 
    This function requires that the codec accept text :class:`str` objects
@@ -251,8 +251,8 @@ wider range of codecs when working with binary files:
 .. function:: iterdecode(iterator, encoding, errors='strict', **kwargs)
 
    Uses an incremental decoder to iteratively decode the input provided by
-   *iterator*. This function is a :term:`generator`.
-   The *errors* argument (as well as any
+   *iterator*. *iterator* must yield :class:`bytes` objects.
+   This function is a :term:`generator`. The *errors* argument (as well as any
    other keyword argument) is passed through to the incremental decoder.
 
    This function requires that the codec accept :class:`bytes` objects