[3.14] gh-150285: Fix too long docstrings in Argument Clinic code (GH-150338) (GH-150350) (GH-150473)

(cherry picked from commit cf73b17adf)
(cherry picked from commit 287c98f4cb)
This commit is contained in:
Serhiy Storchaka 2026-05-27 19:24:18 +03:00 committed by GitHub
parent 26c5468b5d
commit 49975a511f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
71 changed files with 586 additions and 531 deletions

View file

@ -10,8 +10,8 @@ PyDoc_STRVAR(_contextvars_Context_get__doc__,
"\n"
"Return the value for `key` if `key` has the value in the context object.\n"
"\n"
"If `key` does not exist, return `default`. If `default` is not given,\n"
"return None.");
"If `key` does not exist, return `default`. If `default` is not\n"
"given, return None.");
#define _CONTEXTVARS_CONTEXT_GET_METHODDEF \
{"get", _PyCFunction_CAST(_contextvars_Context_get), METH_FASTCALL, _contextvars_Context_get__doc__},
@ -122,10 +122,12 @@ PyDoc_STRVAR(_contextvars_ContextVar_get__doc__,
"\n"
"Return a value for the context variable for the current context.\n"
"\n"
"If there is no value for the variable in the current context, the method will:\n"
" * return the value of the default argument of the method, if provided; or\n"
" * return the default value for the context variable, if it was created\n"
" with one; or\n"
"If there is no value for the variable in the current context, the\n"
"method will:\n"
" * return the value of the default argument of the method, if\n"
" provided; or\n"
" * return the default value for the context variable, if it was\n"
" created with one; or\n"
" * raise a LookupError.");
#define _CONTEXTVARS_CONTEXTVAR_GET_METHODDEF \
@ -160,10 +162,11 @@ PyDoc_STRVAR(_contextvars_ContextVar_set__doc__,
"\n"
"Call to set a new value for the context variable in the current context.\n"
"\n"
"The required value argument is the new value for the context variable.\n"
"The required value argument is the new value for the context\n"
"variable.\n"
"\n"
"Returns a Token object that can be used to restore the variable to its previous\n"
"value via the `ContextVar.reset()` method.");
"Returns a Token object that can be used to restore the variable to\n"
"its previous value via the `ContextVar.reset()` method.");
#define _CONTEXTVARS_CONTEXTVAR_SET_METHODDEF \
{"set", (PyCFunction)_contextvars_ContextVar_set, METH_O, _contextvars_ContextVar_set__doc__},
@ -187,8 +190,8 @@ PyDoc_STRVAR(_contextvars_ContextVar_reset__doc__,
"\n"
"Reset the context variable.\n"
"\n"
"The variable is reset to the value it had before the `ContextVar.set()` that\n"
"created the token was used.");
"The variable is reset to the value it had before the\n"
"`ContextVar.set()` that created the token was used.");
#define _CONTEXTVARS_CONTEXTVAR_RESET_METHODDEF \
{"reset", (PyCFunction)_contextvars_ContextVar_reset, METH_O, _contextvars_ContextVar_reset__doc__},
@ -256,4 +259,4 @@ token_exit(PyObject *self, PyObject *const *args, Py_ssize_t nargs)
exit:
return return_value;
}
/*[clinic end generated code: output=3a04b2fddf24c3e9 input=a9049054013a1b77]*/
/*[clinic end generated code: output=90ec3e4375804e9b input=a9049054013a1b77]*/

View file

@ -34,8 +34,9 @@ PyDoc_STRVAR(_imp_acquire_lock__doc__,
"\n"
"Acquires the interpreter\'s import lock for the current thread.\n"
"\n"
"This lock should be used by import hooks to ensure thread-safety when importing\n"
"modules. On platforms without threads, this function does nothing.");
"This lock should be used by import hooks to ensure thread-safety when\n"
"importing modules. On platforms without threads, this function does\n"
"nothing.");
#define _IMP_ACQUIRE_LOCK_METHODDEF \
{"acquire_lock", (PyCFunction)_imp_acquire_lock, METH_NOARGS, _imp_acquire_lock__doc__},
@ -629,4 +630,4 @@ exit:
#ifndef _IMP_EXEC_DYNAMIC_METHODDEF
#define _IMP_EXEC_DYNAMIC_METHODDEF
#endif /* !defined(_IMP_EXEC_DYNAMIC_METHODDEF) */
/*[clinic end generated code: output=24f597d6b0f3feed input=a9049054013a1b77]*/
/*[clinic end generated code: output=394455063b83475b input=a9049054013a1b77]*/

View file

@ -195,8 +195,8 @@ PyDoc_STRVAR(marshal_dumps__doc__,
" allow_code\n"
" Allow to write code objects.\n"
"\n"
"Raise a ValueError exception if value has (or contains an object that has) an\n"
"unsupported type.");
"Raise a ValueError exception if value has (or contains an object that\n"
"has) an unsupported type.");
#define MARSHAL_DUMPS_METHODDEF \
{"dumps", _PyCFunction_CAST(marshal_dumps), METH_FASTCALL|METH_KEYWORDS, marshal_dumps__doc__},
@ -280,8 +280,8 @@ PyDoc_STRVAR(marshal_loads__doc__,
" allow_code\n"
" Allow to load code objects.\n"
"\n"
"If no valid value is found, raise EOFError, ValueError or TypeError. Extra\n"
"bytes in the input are ignored.");
"If no valid value is found, raise EOFError, ValueError or TypeError.\n"
"Extra bytes in the input are ignored.");
#define MARSHAL_LOADS_METHODDEF \
{"loads", _PyCFunction_CAST(marshal_loads), METH_FASTCALL|METH_KEYWORDS, marshal_loads__doc__},
@ -351,4 +351,4 @@ exit:
return return_value;
}
/*[clinic end generated code: output=3e4bfc070a3c78ac input=a9049054013a1b77]*/
/*[clinic end generated code: output=a574570c3717f60e input=a9049054013a1b77]*/

View file

@ -1396,7 +1396,8 @@ PyDoc_STRVAR(sys__stats_dump__doc__,
"\n"
"Dump stats to file, and clears the stats.\n"
"\n"
"Return False if no statistics were not dumped because stats gathering was off.");
"Return False if no statistics were not dumped because stats gathering\n"
"was off.");
#define SYS__STATS_DUMP_METHODDEF \
{"_stats_dump", (PyCFunction)sys__stats_dump, METH_NOARGS, sys__stats_dump__doc__},
@ -1544,16 +1545,16 @@ PyDoc_STRVAR(sys_remote_exec__doc__,
"Executes a file containing Python code in a given remote Python process.\n"
"\n"
"This function returns immediately, and the code will be executed by the\n"
"target process\'s main thread at the next available opportunity, similarly\n"
"to how signals are handled. There is no interface to determine when the\n"
"code has been executed. The caller is responsible for making sure that\n"
"the file still exists whenever the remote process tries to read it and that\n"
"it hasn\'t been overwritten.\n"
"target process\'s main thread at the next available opportunity,\n"
"similarly to how signals are handled. There is no interface to\n"
"determine when the code has been executed. The caller is responsible\n"
"for making sure that the file still exists whenever the remote process\n"
"tries to read it and that it hasn\'t been overwritten.\n"
"\n"
"The remote process must be running a CPython interpreter of the same major\n"
"and minor version as the local process. If either the local or remote\n"
"interpreter is pre-release (alpha, beta, or release candidate) then the\n"
"local and remote interpreters must be the same exact version.\n"
"The remote process must be running a CPython interpreter of the same\n"
"major and minor version as the local process. If either the local or\n"
"remote interpreter is pre-release (alpha, beta, or release candidate)\n"
"then the local and remote interpreters must be the same exact version.\n"
"\n"
"Args:\n"
" pid (int): The process ID of the target Python process.\n"
@ -1979,4 +1980,4 @@ exit:
#ifndef SYS_GETANDROIDAPILEVEL_METHODDEF
#define SYS_GETANDROIDAPILEVEL_METHODDEF
#endif /* !defined(SYS_GETANDROIDAPILEVEL_METHODDEF) */
/*[clinic end generated code: output=9052f399f40ca32d input=a9049054013a1b77]*/
/*[clinic end generated code: output=407915aef6734c56 input=a9049054013a1b77]*/