Browse Source
bpo-37751: Update `codecs.register()` doc. (GH-25643)
pull/21682/merge
Inada Naoki
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
7 additions and
3 deletions
-
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) |
|
|
|
|