GH-137623: Use an AC decorator for docstring line length enforcement (#137690)

This commit is contained in:
Adam Turner 2025-08-18 18:29:00 +01:00 committed by GitHub
parent 0324c726de
commit 918e3ba6c0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
76 changed files with 569 additions and 570 deletions

View file

@ -251,6 +251,7 @@ PyDoc_STRVAR(build_class_doc,
Internal helper function used by the class statement.");
/*[clinic input]
@permit_long_docstring_body
__import__ as builtin___import__
name: object
@ -279,7 +280,7 @@ is the number of parent directories to search relative to the current module.
static PyObject *
builtin___import___impl(PyObject *module, PyObject *name, PyObject *globals,
PyObject *locals, PyObject *fromlist, int level)
/*[clinic end generated code: output=4febeda88a0cd245 input=73f4b960ea5b9dd6]*/
/*[clinic end generated code: output=4febeda88a0cd245 input=01a3283590eae93a]*/
{
return PyImport_ImportModuleLevelObject(name, globals, locals,
fromlist, level);

View file

@ -1007,6 +1007,7 @@ contextvar_tp_repr(PyObject *op)
/*[clinic input]
@permit_long_docstring_body
_contextvars.ContextVar.get
default: object = NULL
/
@ -1022,7 +1023,7 @@ If there is no value for the variable in the current context, the method will:
static PyObject *
_contextvars_ContextVar_get_impl(PyContextVar *self, PyObject *default_value)
/*[clinic end generated code: output=0746bd0aa2ced7bf input=30aa2ab9e433e401]*/
/*[clinic end generated code: output=0746bd0aa2ced7bf input=da66664d5d0af4ad]*/
{
if (!PyContextVar_CheckExact(self)) {
PyErr_SetString(
@ -1044,6 +1045,7 @@ _contextvars_ContextVar_get_impl(PyContextVar *self, PyObject *default_value)
}
/*[clinic input]
@permit_long_docstring_body
_contextvars.ContextVar.set
value: object
/
@ -1058,12 +1060,13 @@ value via the `ContextVar.reset()` method.
static PyObject *
_contextvars_ContextVar_set_impl(PyContextVar *self, PyObject *value)
/*[clinic end generated code: output=1b562d35cc79c806 input=c0a6887154227453]*/
/*[clinic end generated code: output=1b562d35cc79c806 input=73ebbbfc7c98f6cd]*/
{
return PyContextVar_Set((PyObject *)self, value);
}
/*[clinic input]
@permit_long_docstring_body
_contextvars.ContextVar.reset
token: object
/
@ -1076,7 +1079,7 @@ created the token was used.
static PyObject *
_contextvars_ContextVar_reset_impl(PyContextVar *self, PyObject *token)
/*[clinic end generated code: output=3205d2bdff568521 input=ebe2881e5af4ffda]*/
/*[clinic end generated code: output=3205d2bdff568521 input=b8bc514a9245242a]*/
{
if (!PyContextToken_CheckExact(token)) {
PyErr_Format(PyExc_TypeError,

View file

@ -4259,6 +4259,7 @@ _imp_lock_held_impl(PyObject *module)
}
/*[clinic input]
@permit_long_docstring_body
_imp.acquire_lock
Acquires the interpreter's import lock for the current thread.
@ -4269,7 +4270,7 @@ modules. On platforms without threads, this function does nothing.
static PyObject *
_imp_acquire_lock_impl(PyObject *module)
/*[clinic end generated code: output=1aff58cb0ee1b026 input=4a2d4381866d5fdc]*/
/*[clinic end generated code: output=1aff58cb0ee1b026 input=e1a4ef049d34e7dd]*/
{
PyInterpreterState *interp = _PyInterpreterState_GET();
_PyImport_AcquireLock(interp);

View file

@ -1997,6 +1997,8 @@ marshal_load_impl(PyObject *module, PyObject *file, int allow_code)
}
/*[clinic input]
@permit_long_summary
@permit_long_docstring_body
marshal.dumps
value: object
@ -2017,7 +2019,7 @@ unsupported type.
static PyObject *
marshal_dumps_impl(PyObject *module, PyObject *value, int version,
int allow_code)
/*[clinic end generated code: output=115f90da518d1d49 input=167eaecceb63f0a8]*/
/*[clinic end generated code: output=115f90da518d1d49 input=80cd3f30c1637ade]*/
{
return _PyMarshal_WriteObjectToString(value, version, allow_code);
}

View file

@ -1160,6 +1160,7 @@ sys_settrace(PyObject *module, PyObject *function)
}
/*[clinic input]
@permit_long_summary
sys._settraceallthreads
function as arg: object
@ -1173,7 +1174,7 @@ in the library manual.
static PyObject *
sys__settraceallthreads(PyObject *module, PyObject *arg)
/*[clinic end generated code: output=161cca30207bf3ca input=d4bde1f810d73675]*/
/*[clinic end generated code: output=161cca30207bf3ca input=e5750f5dc01142eb]*/
{
PyObject* argument = NULL;
Py_tracefunc func = NULL;
@ -1241,6 +1242,7 @@ sys_setprofile(PyObject *module, PyObject *function)
}
/*[clinic input]
@permit_long_summary
sys._setprofileallthreads
function as arg: object
@ -1254,7 +1256,7 @@ chapter in the library manual.
static PyObject *
sys__setprofileallthreads(PyObject *module, PyObject *arg)
/*[clinic end generated code: output=2d61319e27b309fe input=a10589439ba20cee]*/
/*[clinic end generated code: output=2d61319e27b309fe input=9a3dc3352c63b471]*/
{
PyObject* argument = NULL;
Py_tracefunc func = NULL;
@ -2141,6 +2143,7 @@ sys__current_frames_impl(PyObject *module)
}
/*[clinic input]
@permit_long_summary
sys._current_exceptions
Return a dict mapping each thread's identifier to its current raised exception.
@ -2150,7 +2153,7 @@ This function should be used for specialized purposes only.
static PyObject *
sys__current_exceptions_impl(PyObject *module)
/*[clinic end generated code: output=2ccfd838c746f0ba input=0e91818fbf2edc1f]*/
/*[clinic end generated code: output=2ccfd838c746f0ba input=4ba429b6cfcd736d]*/
{
return _PyThread_CurrentExceptions();
}
@ -2311,6 +2314,7 @@ sys__stats_clear_impl(PyObject *module)
}
/*[clinic input]
@permit_long_docstring_body
sys._stats_dump -> bool
Dump stats to file, and clears the stats.
@ -2320,7 +2324,7 @@ Return False if no statistics were not dumped because stats gathering was off.
static int
sys__stats_dump_impl(PyObject *module)
/*[clinic end generated code: output=6e346b4ba0de4489 input=31a489e39418b2a5]*/
/*[clinic end generated code: output=6e346b4ba0de4489 input=5a3ab40d2fb5af47]*/
{
int res = _Py_PrintSpecializationStats(1);
_Py_StatsClear();
@ -4017,13 +4021,14 @@ module _jit
PyDoc_STRVAR(_jit_doc, "Utilities for observing just-in-time compilation.");
/*[clinic input]
@permit_long_summary
_jit.is_available -> bool
Return True if the current Python executable supports JIT compilation, and False otherwise.
[clinic start generated code]*/
static int
_jit_is_available_impl(PyObject *module)
/*[clinic end generated code: output=6849a9cd2ff4aac9 input=03add84aa8347cf1]*/
/*[clinic end generated code: output=6849a9cd2ff4aac9 input=d009d751ae64c9ef]*/
{
(void)module;
#ifdef _Py_TIER2
@ -4034,26 +4039,28 @@ _jit_is_available_impl(PyObject *module)
}
/*[clinic input]
@permit_long_summary
_jit.is_enabled -> bool
Return True if JIT compilation is enabled for the current Python process (implies sys._jit.is_available()), and False otherwise.
[clinic start generated code]*/
static int
_jit_is_enabled_impl(PyObject *module)
/*[clinic end generated code: output=55865f8de993fe42 input=02439394da8e873f]*/
/*[clinic end generated code: output=55865f8de993fe42 input=0524151e857f4f3a]*/
{
(void)module;
return _PyInterpreterState_GET()->jit;
}
/*[clinic input]
@permit_long_summary
_jit.is_active -> bool
Return True if the topmost Python frame is currently executing JIT code (implies sys._jit.is_enabled()), and False otherwise.
[clinic start generated code]*/
static int
_jit_is_active_impl(PyObject *module)
/*[clinic end generated code: output=7facca06b10064d4 input=be2fcd8a269d9b72]*/
/*[clinic end generated code: output=7facca06b10064d4 input=081ee32563dc2086]*/
{
(void)module;
return _PyThreadState_GET()->current_executor != NULL;