Skip to content

Commit f1dcf3c

Browse files
gh-53243: Document codecs.readbuffer_encode() (#136284)
Closes #53243
1 parent 301b29d commit f1dcf3c

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Doc/library/codecs.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,20 @@ wider range of codecs when working with binary files:
265265
:func:`iterencode`.
266266

267267

268+
.. function:: readbuffer_encode(buffer, errors=None, /)
269+
270+
Return a :class:`tuple` containing the raw bytes of *buffer*, a
271+
:ref:`buffer-compatible object <bufferobjects>` or :class:`str`
272+
(encoded to UTF-8 before processing), and their length in bytes.
273+
274+
The *errors* argument is ignored.
275+
276+
.. code-block:: pycon
277+
278+
>>> codecs.readbuffer_encode(b"Zito")
279+
(b'Zito', 4)
280+
281+
268282
The module also provides the following constants which are useful for reading
269283
and writing to platform dependent files:
270284

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy