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

(cherry picked from commit 5c84bb506a)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
This commit is contained in:
Miss Islington (bot) 2021-04-27 19:26:11 -07:00 committed by GitHub
parent 5cadcec5ec
commit cf9d65c5af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View 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::