Skip to content

Commit 4e7485c

Browse files
Doc
1 parent b330897 commit 4e7485c

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Doc/library/codecs.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,21 @@ 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`, and their
272+
length.
273+
274+
The *errors* argument is ignored and exists only for compatibility with
275+
other functions.
276+
277+
.. code-block:: pycon
278+
279+
>>> codecs.readbuffer_encode(b"Zito")
280+
(b'Zito', 4)
281+
282+
268283
The module also provides the following constants which are useful for reading
269284
and writing to platform dependent files:
270285

0 commit comments

Comments
 (0)