]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-37751: Update `codecs.register()` doc. (GH-25643)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 28 Apr 2021 02:26:11 +0000 (19:26 -0700)
committerGitHub <noreply@github.com>
Wed, 28 Apr 2021 02:26:11 +0000 (11:26 +0900)
(cherry picked from commit 5c84bb506aaca01f5f750116d8f7a41d41f8124d)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
Doc/library/codecs.rst

index 32fbc831ca2c8793b18df759fdc342a0a392eaea..3338545e9267dc08aacab50129a0af72e574e43b 100644 (file)
@@ -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::