From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Thu, 10 Jul 2025 15:41:31 +0000 (+0200) Subject: [3.14] gh-82663: Clarify `codecs.iterdecode/encode` docs (GH-136497) (#136513) X-Git-Tag: v3.14.0rc1~100 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=326fe0df66afbe94475e5609adeb1ea7a4956899;p=thirdparty%2FPython%2Fcpython.git [3.14] gh-82663: Clarify `codecs.iterdecode/encode` docs (GH-136497) (#136513) 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> --- diff --git a/Doc/library/codecs.rst b/Doc/library/codecs.rst index 0e84f18dd4d5..37bd913b765d 100644 --- a/Doc/library/codecs.rst +++ b/Doc/library/codecs.rst @@ -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