summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorInada Naoki <songofacandy@gmail.com>2021-04-28 00:37:02 (GMT)
committerGitHub <noreply@github.com>2021-04-28 00:37:02 (GMT)
commit5c84bb506aaca01f5f750116d8f7a41d41f8124d (patch)
tree5a1461902fe84f83fa67ba6dfc6f7971199a0abd
parenta09766deab5aff549f40f27080895e148af922ed (diff)
downloadcpython-5c84bb506aaca01f5f750116d8f7a41d41f8124d.zip
cpython-5c84bb506aaca01f5f750116d8f7a41d41f8124d.tar.gz
cpython-5c84bb506aaca01f5f750116d8f7a41d41f8124d.tar.bz2
bpo-37751: Update `codecs.register()` doc. (GH-25643)
-rw-r--r--Doc/library/codecs.rst10
1 files changed, 7 insertions, 3 deletions
diff --git a/Doc/library/codecs.rst b/Doc/library/codecs.rst
index b15d293..0dcd88f 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.
.. function:: unregister(search_function)