[Python-checkins] bpo-37751: Update `codecs.register()` doc. (GH-25643)

methane webhook-mailer at python.org
Tue Apr 27 22:26:18 EDT 2021


https://github.com/python/cpython/commit/cf9d65c5af7905d9e9945a297dbbf15d3bcace15
commit: cf9d65c5af7905d9e9945a297dbbf15d3bcace15
branch: 3.9
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: methane <songofacandy at gmail.com>
date: 2021-04-28T11:26:11+09:00
summary:

bpo-37751: Update `codecs.register()` doc. (GH-25643)

(cherry picked from commit 5c84bb506aaca01f5f750116d8f7a41d41f8124d)

Co-authored-by: Inada Naoki <songofacandy at gmail.com>

files:
M Doc/library/codecs.rst

diff --git a/Doc/library/codecs.rst b/Doc/library/codecs.rst
index 32fbc831ca2c8..3338545e9267d 100644
--- a/Doc/library/codecs.rst
+++ b/Doc/library/codecs.rst
@@ -159,9 +159,13 @@ function:
 .. function:: register(search_function)
 
    Register a codec search function. Search functions are expected to take one
-   argument, being the encoding name in all lower case letters, and return a
-   :class:`CodecInfo` object. In case a search function cannot find
-   a given encoding, it should return ``None``.
+   argument, being the encoding name in all lower case letters with hyphens
+   and spaces converted to underscores, and return a :class:`CodecInfo` object.
+   In case a search function cannot find a given encoding, it should return
+   ``None``.
+
+   .. versionchanged:: 3.9
+      Hyphens and spaces are converted to underscore.
 
    .. note::
 



More information about the Python-checkins mailing list