Skip to content

Commit bd47ec9

Browse files
authored
gh-131885: Document / for codecs functions (#131992)
1 parent 939476b commit bd47ec9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Doc/library/codecs.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ any codec:
5555

5656
The full details for each codec can also be looked up directly:
5757

58-
.. function:: lookup(encoding)
58+
.. function:: lookup(encoding, /)
5959

6060
Looks up the codec info in the Python codec registry and returns a
6161
:class:`CodecInfo` object as defined below.
@@ -156,7 +156,7 @@ these additional functions which use :func:`lookup` for the codec lookup:
156156
Custom codecs are made available by registering a suitable codec search
157157
function:
158158

159-
.. function:: register(search_function)
159+
.. function:: register(search_function, /)
160160

161161
Register a codec search function. Search functions are expected to take one
162162
argument, being the encoding name in all lower case letters with hyphens
@@ -168,7 +168,7 @@ function:
168168
Hyphens and spaces are converted to underscore.
169169

170170

171-
.. function:: unregister(search_function)
171+
.. function:: unregister(search_function, /)
172172

173173
Unregister a codec search function and clear the registry's cache.
174174
If the search function is not registered, do nothing.
@@ -416,7 +416,7 @@ In addition, the following error handler is specific to the given codecs:
416416
The set of allowed values can be extended by registering a new named error
417417
handler:
418418

419-
.. function:: register_error(name, error_handler)
419+
.. function:: register_error(name, error_handler, /)
420420

421421
Register the error handling function *error_handler* under the name *name*.
422422
The *error_handler* argument will be called during encoding and decoding
@@ -442,7 +442,7 @@ handler:
442442
Previously registered error handlers (including the standard error handlers)
443443
can be looked up by name:
444444

445-
.. function:: lookup_error(name)
445+
.. function:: lookup_error(name, /)
446446

447447
Return the error handler previously registered under the name *name*.
448448

0 commit comments

Comments
 (0)