# HG changeset patch # Parent 4a55b98314cd690ee7526cc5fd5d9cc1fec40972 Issue #23231: Document codecs.iterencode(), iterdecode() shortcomings diff -r 4a55b98314cd Doc/library/codecs.rst --- a/Doc/library/codecs.rst Mon Jan 12 21:03:41 2015 +0100 +++ b/Doc/library/codecs.rst Sat Aug 20 09:21:11 2016 +0000 @@ -221,6 +221,10 @@ 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 + to encode. Therefore it does not support bytes-to-bytes encoders such as + ``base64_codec``. + .. function:: iterdecode(iterator, encoding, errors='strict', **kwargs) @@ -229,6 +233,11 @@ 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 + to decode. Therefore it does not support text-to-text encoders such as + ``rot_13``, although ``rot_13`` may be used equivalently with + :func:`iterencode`. + The module also provides the following constants which are useful for reading and writing to platform dependent files: