mirror of
https://github.com/python/cpython.git
synced 2026-06-18 23:53:28 +00:00
[3.14] gh-150285: Fix too long docstrings in Argument Clinic code (GH-150338) (GH-150350) (GH-150473)
(cherry picked from commitcf73b17adf) (cherry picked from commit287c98f4cb)
This commit is contained in:
parent
26c5468b5d
commit
49975a511f
71 changed files with 586 additions and 531 deletions
|
|
@ -55,14 +55,15 @@ _codecs.register
|
|||
|
||||
Register a codec search function.
|
||||
|
||||
Search functions are expected to take one argument, the encoding name in
|
||||
all lower case letters, and either return None, or a tuple of functions
|
||||
(encoder, decoder, stream_reader, stream_writer) (or a CodecInfo object).
|
||||
Search functions are expected to take one argument, the encoding
|
||||
name in all lower case letters, and either return None, or a tuple
|
||||
of functions (encoder, decoder, stream_reader, stream_writer) (or
|
||||
a CodecInfo object).
|
||||
[clinic start generated code]*/
|
||||
|
||||
static PyObject *
|
||||
_codecs_register(PyObject *module, PyObject *search_function)
|
||||
/*[clinic end generated code: output=d1bf21e99db7d6d3 input=369578467955cae4]*/
|
||||
/*[clinic end generated code: output=d1bf21e99db7d6d3 input=2321d8c8c0420dfc]*/
|
||||
{
|
||||
if (PyCodec_Register(search_function))
|
||||
return NULL;
|
||||
|
|
@ -115,16 +116,16 @@ _codecs.encode
|
|||
Encodes obj using the codec registered for encoding.
|
||||
|
||||
The default encoding is 'utf-8'. errors may be given to set a
|
||||
different error handling scheme. Default is 'strict' meaning that encoding
|
||||
errors raise a ValueError. Other possible values are 'ignore', 'replace'
|
||||
and 'backslashreplace' as well as any other name registered with
|
||||
codecs.register_error that can handle ValueErrors.
|
||||
different error handling scheme. Default is 'strict' meaning that
|
||||
encoding errors raise a ValueError. Other possible values are 'ignore',
|
||||
'replace' and 'backslashreplace' as well as any other name registered
|
||||
with codecs.register_error that can handle ValueErrors.
|
||||
[clinic start generated code]*/
|
||||
|
||||
static PyObject *
|
||||
_codecs_encode_impl(PyObject *module, PyObject *obj, const char *encoding,
|
||||
const char *errors)
|
||||
/*[clinic end generated code: output=385148eb9a067c86 input=cd5b685040ff61f0]*/
|
||||
/*[clinic end generated code: output=385148eb9a067c86 input=e5271d443e391d7f]*/
|
||||
{
|
||||
if (encoding == NULL)
|
||||
encoding = PyUnicode_GetDefaultEncoding();
|
||||
|
|
@ -142,16 +143,16 @@ _codecs.decode
|
|||
Decodes obj using the codec registered for encoding.
|
||||
|
||||
Default encoding is 'utf-8'. errors may be given to set a
|
||||
different error handling scheme. Default is 'strict' meaning that encoding
|
||||
errors raise a ValueError. Other possible values are 'ignore', 'replace'
|
||||
and 'backslashreplace' as well as any other name registered with
|
||||
codecs.register_error that can handle ValueErrors.
|
||||
different error handling scheme. Default is 'strict' meaning that
|
||||
encoding errors raise a ValueError. Other possible values are 'ignore',
|
||||
'replace' and 'backslashreplace' as well as any other name registered
|
||||
with codecs.register_error that can handle ValueErrors.
|
||||
[clinic start generated code]*/
|
||||
|
||||
static PyObject *
|
||||
_codecs_decode_impl(PyObject *module, PyObject *obj, const char *encoding,
|
||||
const char *errors)
|
||||
/*[clinic end generated code: output=679882417dc3a0bd input=7702c0cc2fa1add6]*/
|
||||
/*[clinic end generated code: output=679882417dc3a0bd input=3e6254628f9ca538]*/
|
||||
{
|
||||
if (encoding == NULL)
|
||||
encoding = PyUnicode_GetDefaultEncoding();
|
||||
|
|
@ -966,14 +967,15 @@ _codecs.register_error
|
|||
Register the specified error handler under the name errors.
|
||||
|
||||
handler must be a callable object, that will be called with an exception
|
||||
instance containing information about the location of the encoding/decoding
|
||||
error and must return a (replacement, new position) tuple.
|
||||
instance containing information about the location of the
|
||||
encoding/decoding error and must return a (replacement, new position)
|
||||
tuple.
|
||||
[clinic start generated code]*/
|
||||
|
||||
static PyObject *
|
||||
_codecs_register_error_impl(PyObject *module, const char *errors,
|
||||
PyObject *handler)
|
||||
/*[clinic end generated code: output=fa2f7d1879b3067d input=5e6709203c2e33fe]*/
|
||||
/*[clinic end generated code: output=fa2f7d1879b3067d input=5bea01dfe835d9d8]*/
|
||||
{
|
||||
if (PyCodec_RegisterError(errors, handler))
|
||||
return NULL;
|
||||
|
|
@ -1011,13 +1013,13 @@ _codecs.lookup_error
|
|||
|
||||
lookup_error(errors) -> handler
|
||||
|
||||
Return the error handler for the specified error handling name or raise a
|
||||
LookupError, if no handler exists under this name.
|
||||
Return the error handler for the specified error handling name or raise
|
||||
a LookupError, if no handler exists under this name.
|
||||
[clinic start generated code]*/
|
||||
|
||||
static PyObject *
|
||||
_codecs_lookup_error_impl(PyObject *module, const char *name)
|
||||
/*[clinic end generated code: output=087f05dc0c9a98cc input=4775dd65e6235aba]*/
|
||||
/*[clinic end generated code: output=087f05dc0c9a98cc input=86cfb6a7a9c67113]*/
|
||||
{
|
||||
return PyCodec_LookupError(name);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue