From: Inada Naoki Date: Wed, 28 Apr 2021 00:37:02 +0000 (+0900) Subject: bpo-37751: Update `codecs.register()` doc. (GH-25643) X-Git-Tag: v3.10.0b1~125 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5c84bb506aaca01f5f750116d8f7a41d41f8124d;p=thirdparty%2FPython%2Fcpython.git bpo-37751: Update `codecs.register()` doc. (GH-25643) --- diff --git a/Doc/library/codecs.rst b/Doc/library/codecs.rst index b15d293e38f6..0dcd88f9fd5b 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)