gh-82663: Clarify codecs.iterdecode/encode docs (#136497)

Closes #82663
This commit is contained in:
Stan Ulbrych
2025-07-10 17:31:08 +02:00
committed by GitHub
parent f1b8d01c80
commit 4b41b2043b

View 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