]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-82663: Clarify `codecs.iterdecode/encode` docs (#136497)
authorStan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Thu, 10 Jul 2025 15:31:08 +0000 (17:31 +0200)
committerGitHub <noreply@github.com>
Thu, 10 Jul 2025 15:31:08 +0000 (17:31 +0200)
Closes #82663

Doc/library/codecs.rst

index 0e84f18dd4d5d54e1edab87e85e9a70ae4801c06..37bd913b765d2149589b16da99b08005d6d02e92 100644 (file)
@@ -243,8 +243,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
@@ -255,8 +255,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