https://github.com/python/cpython/commit/ef4a70b63f313e835bb35efa76ea866594d464a7
commit: ef4a70b63f313e835bb35efa76ea866594d464a7
branch: 3.13
author: Miss Islington (bot) <[email protected]>
committer: malemburg <[email protected]>
date: 2025-06-30T15:52:53+02:00
summary:

[3.13] gh-48181: Document `codecs.charmap_build` (GH-135997) (#136124)

gh-48181: Document `codecs.charmap_build` (GH-135997)
(cherry picked from commit 2bdd50309f543f449d7d82b64ed6f60ae0aa80b9)

Co-authored-by: Stan Ulbrych <[email protected]>

files:
M Doc/library/codecs.rst

diff --git a/Doc/library/codecs.rst b/Doc/library/codecs.rst
index 95600953e5aa88..962c81d599e8e8 100644
--- a/Doc/library/codecs.rst
+++ b/Doc/library/codecs.rst
@@ -53,6 +53,14 @@ any codec:
    :exc:`UnicodeDecodeError`). Refer to :ref:`codec-base-classes` for more
    information on codec error handling.
 
+.. function:: charmap_build(string)
+
+   Return a mapping suitable for encoding with a custom single-byte encoding.
+   Given a :class:`str` *string* of up to 256 characters representing a
+   decoding table, returns either a compact internal mapping object
+   ``EncodingMap`` or a :class:`dictionary <dict>` mapping character ordinals
+   to byte values. Raises a :exc:`TypeError` on invalid input.
+
 The full details for each codec can also be looked up directly:
 
 .. function:: lookup(encoding)

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to