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

@ -1374,6 +1374,7 @@ array_array_insert_impl(arrayobject *self, Py_ssize_t i, PyObject *v)
}
/*[clinic input]
@permit_long_summary
array.array.buffer_info
Return a tuple (address, length) giving the current memory address and the length in items of the buffer used to hold array's contents.
@ -1384,7 +1385,7 @@ the buffer length in bytes.
static PyObject *
array_array_buffer_info_impl(arrayobject *self)
/*[clinic end generated code: output=9b2a4ec3ae7e98e7 input=a58bae5c6e1ac6a6]*/
/*[clinic end generated code: output=9b2a4ec3ae7e98e7 input=63d9ad83ba60cda8]*/
{
PyObject *retval = NULL, *v;
@ -1426,6 +1427,7 @@ array_array_append_impl(arrayobject *self, PyObject *v)
}
/*[clinic input]
@permit_long_docstring_body
array.array.byteswap
Byteswap all items of the array.
@ -1436,7 +1438,7 @@ raised.
static PyObject *
array_array_byteswap_impl(arrayobject *self)
/*[clinic end generated code: output=5f8236cbdf0d90b5 input=6a85591b950a0186]*/
/*[clinic end generated code: output=5f8236cbdf0d90b5 input=9af1d1749000b14f]*/
{
char *p;
Py_ssize_t i;
@ -1519,6 +1521,7 @@ array_array_reverse_impl(arrayobject *self)
}
/*[clinic input]
@permit_long_summary
array.array.fromfile
cls: defining_class
@ -1532,7 +1535,7 @@ Read n objects from the file object f and append them to the end of the array.
static PyObject *
array_array_fromfile_impl(arrayobject *self, PyTypeObject *cls, PyObject *f,
Py_ssize_t n)
/*[clinic end generated code: output=83a667080b345ebc input=3822e907c1c11f1a]*/
/*[clinic end generated code: output=83a667080b345ebc input=b2b4bdfb7ad4d4ae]*/
{
PyObject *b, *res;
Py_ssize_t itemsize = self->ob_descr->itemsize;
@ -1739,6 +1742,7 @@ frombytes(arrayobject *self, Py_buffer *buffer)
}
/*[clinic input]
@permit_long_summary
array.array.frombytes
buffer: Py_buffer
@ -1749,12 +1753,13 @@ Appends items from the string, interpreting it as an array of machine values, as
static PyObject *
array_array_frombytes_impl(arrayobject *self, Py_buffer *buffer)
/*[clinic end generated code: output=d9842c8f7510a516 input=378db226dfac949e]*/
/*[clinic end generated code: output=d9842c8f7510a516 input=6b90ce5895f677a4]*/
{
return frombytes(self, buffer);
}
/*[clinic input]
@permit_long_summary
array.array.tobytes
Convert the array to an array of machine values and return the bytes representation.
@ -1762,7 +1767,7 @@ Convert the array to an array of machine values and return the bytes representat
static PyObject *
array_array_tobytes_impl(arrayobject *self)
/*[clinic end generated code: output=87318e4edcdc2bb6 input=90ee495f96de34f5]*/
/*[clinic end generated code: output=87318e4edcdc2bb6 input=41081256b97f9d7a]*/
{
if (Py_SIZE(self) <= PY_SSIZE_T_MAX / self->ob_descr->itemsize) {
return PyBytes_FromStringAndSize(self->ob_item,
@ -1773,6 +1778,7 @@ array_array_tobytes_impl(arrayobject *self)
}
/*[clinic input]
@permit_long_docstring_body
array.array.fromunicode
ustr: unicode
@ -1787,7 +1793,7 @@ some other type.
static PyObject *
array_array_fromunicode_impl(arrayobject *self, PyObject *ustr)
/*[clinic end generated code: output=24359f5e001a7f2b input=025db1fdade7a4ce]*/
/*[clinic end generated code: output=24359f5e001a7f2b input=158d47c302f27ca1]*/
{
int typecode = self->ob_descr->typecode;
if (typecode != 'u' && typecode != 'w') {
@ -1835,6 +1841,7 @@ array_array_fromunicode_impl(arrayobject *self, PyObject *ustr)
}
/*[clinic input]
@permit_long_docstring_body
array.array.tounicode
Extends this array with data from the unicode string ustr.
@ -1846,7 +1853,7 @@ unicode string from an array of some other type.
static PyObject *
array_array_tounicode_impl(arrayobject *self)
/*[clinic end generated code: output=08e442378336e1ef input=127242eebe70b66d]*/
/*[clinic end generated code: output=08e442378336e1ef input=6690997213d219db]*/
{
int typecode = self->ob_descr->typecode;
if (typecode != 'u' && typecode != 'w') {