Skip to content

Commit 918e3ba

Browse files
authored
GH-137623: Use an AC decorator for docstring line length enforcement (#137690)
1 parent 0324c72 commit 918e3ba

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+569
-570
lines changed

Lib/test/clinic.test.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4080,13 +4080,14 @@ test_preprocessor_guarded_if_with_continuation_impl(PyObject *module)
40804080
#if CONDITION_E || CONDITION_F
40814081
#warning "different type of CPP directive"
40824082
/*[clinic input]
4083+
@permit_long_summary
40834084
test_preprocessor_guarded_if_e_or_f
40844085
Makes sure cpp.Monitor handles other directives than preprocessor conditionals.
40854086
[clinic start generated code]*/
40864087

40874088
static PyObject *
40884089
test_preprocessor_guarded_if_e_or_f_impl(PyObject *module)
4089-
/*[clinic end generated code: output=e49d24ff64ad88bc input=57b9c37f938bc4f1]*/
4090+
/*[clinic end generated code: output=e49d24ff64ad88bc input=3ca9ab4e883300ed]*/
40904091
#endif
40914092

40924093
/*[clinic input]

Modules/_abc.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,7 @@ compute_abstract_methods(PyObject *self)
484484
#define COLLECTION_FLAGS (Py_TPFLAGS_SEQUENCE | Py_TPFLAGS_MAPPING)
485485

486486
/*[clinic input]
487+
@permit_long_summary
487488
_abc._abc_init
488489
489490
self: object
@@ -494,7 +495,7 @@ Internal ABC helper for class set-up. Should be never used outside abc module.
494495

495496
static PyObject *
496497
_abc__abc_init(PyObject *module, PyObject *self)
497-
/*[clinic end generated code: output=594757375714cda1 input=8d7fe470ff77f029]*/
498+
/*[clinic end generated code: output=594757375714cda1 input=0b3513f947736d39]*/
498499
{
499500
_abcmodule_state *state = get_abc_state(module);
500501
PyObject *data;
@@ -543,6 +544,7 @@ _abc__abc_init(PyObject *module, PyObject *self)
543544
}
544545

545546
/*[clinic input]
547+
@permit_long_summary
546548
_abc._abc_register
547549
548550
self: object
@@ -554,7 +556,7 @@ Internal ABC helper for subclasss registration. Should be never used outside abc
554556

555557
static PyObject *
556558
_abc__abc_register_impl(PyObject *module, PyObject *self, PyObject *subclass)
557-
/*[clinic end generated code: output=7851e7668c963524 input=ca589f8c3080e67f]*/
559+
/*[clinic end generated code: output=7851e7668c963524 input=135ab13a581b4414]*/
558560
{
559561
if (!PyType_Check(subclass)) {
560562
PyErr_SetString(PyExc_TypeError, "Can only register classes");
@@ -606,6 +608,7 @@ _abc__abc_register_impl(PyObject *module, PyObject *self, PyObject *subclass)
606608

607609

608610
/*[clinic input]
611+
@permit_long_summary
609612
_abc._abc_instancecheck
610613
611614
self: object
@@ -618,7 +621,7 @@ Internal ABC helper for instance checks. Should be never used outside abc module
618621
static PyObject *
619622
_abc__abc_instancecheck_impl(PyObject *module, PyObject *self,
620623
PyObject *instance)
621-
/*[clinic end generated code: output=b8b5148f63b6b56f input=a4f4525679261084]*/
624+
/*[clinic end generated code: output=b8b5148f63b6b56f input=0bbc8da0ea346719]*/
622625
{
623626
PyObject *subtype, *result = NULL, *subclass = NULL;
624627
_abc_data *impl = _get_impl(module, self);
@@ -692,6 +695,7 @@ static int subclasscheck_check_registry(_abc_data *impl, PyObject *subclass,
692695
PyObject **result);
693696

694697
/*[clinic input]
698+
@permit_long_summary
695699
_abc._abc_subclasscheck
696700
697701
self: object
@@ -704,7 +708,7 @@ Internal ABC helper for subclasss checks. Should be never used outside abc modul
704708
static PyObject *
705709
_abc__abc_subclasscheck_impl(PyObject *module, PyObject *self,
706710
PyObject *subclass)
707-
/*[clinic end generated code: output=b56c9e4a530e3894 input=1d947243409d10b8]*/
711+
/*[clinic end generated code: output=b56c9e4a530e3894 input=5bf1ef712f5d3610]*/
708712
{
709713
if (!PyType_Check(subclass)) {
710714
PyErr_SetString(PyExc_TypeError, "issubclass() arg 1 must be a class");

Modules/_bz2module.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,7 @@ decompress(BZ2Decompressor *d, char *data, size_t len, Py_ssize_t max_length)
598598
}
599599

600600
/*[clinic input]
601+
@permit_long_docstring_body
601602
_bz2.BZ2Decompressor.decompress
602603
603604
data: Py_buffer
@@ -622,7 +623,7 @@ the unused_data attribute.
622623
static PyObject *
623624
_bz2_BZ2Decompressor_decompress_impl(BZ2Decompressor *self, Py_buffer *data,
624625
Py_ssize_t max_length)
625-
/*[clinic end generated code: output=23e41045deb240a3 input=52e1ffc66a8ea624]*/
626+
/*[clinic end generated code: output=23e41045deb240a3 input=3703e78f91757655]*/
626627
{
627628
PyObject *result = NULL;
628629

Modules/_codecsmodule.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ _codecs_unregister(PyObject *module, PyObject *search_function)
9292
}
9393

9494
/*[clinic input]
95+
@permit_long_summary
9596
_codecs.lookup
9697
encoding: str
9798
/
@@ -101,7 +102,7 @@ Looks up a codec tuple in the Python codec registry and returns a CodecInfo obje
101102

102103
static PyObject *
103104
_codecs_lookup_impl(PyObject *module, const char *encoding)
104-
/*[clinic end generated code: output=9f0afa572080c36d input=3c572c0db3febe9c]*/
105+
/*[clinic end generated code: output=9f0afa572080c36d input=02227d5429491ab3]*/
105106
{
106107
return _PyCodec_Lookup(encoding);
107108
}

Modules/_ctypes/callproc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1787,6 +1787,7 @@ align_func(PyObject *self, PyObject *obj)
17871787

17881788

17891789
/*[clinic input]
1790+
@permit_long_summary
17901791
@critical_section obj
17911792
_ctypes.byref
17921793
obj: object(subclass_of="clinic_state()->PyCData_Type")
@@ -1798,7 +1799,7 @@ Return a pointer lookalike to a C instance, only usable as function argument.
17981799

17991800
static PyObject *
18001801
_ctypes_byref_impl(PyObject *module, PyObject *obj, Py_ssize_t offset)
1801-
/*[clinic end generated code: output=60dec5ed520c71de input=6ec02d95d15fbd56]*/
1802+
/*[clinic end generated code: output=60dec5ed520c71de input=870076149a2de427]*/
18021803
{
18031804
ctypes_state *st = get_module_state(module);
18041805

Modules/_curses_panel.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,7 @@ _curses_panel_panel_bottom_impl(PyCursesPanelObject *self)
360360
}
361361

362362
/*[clinic input]
363+
@permit_long_docstring_body
363364
_curses_panel.panel.hide
364365
365366
Hide the panel.
@@ -369,7 +370,7 @@ This does not delete the object, it just makes the window on screen invisible.
369370

370371
static PyObject *
371372
_curses_panel_panel_hide_impl(PyCursesPanelObject *self)
372-
/*[clinic end generated code: output=a7bbbd523e1eab49 input=f6ab884e99386118]*/
373+
/*[clinic end generated code: output=a7bbbd523e1eab49 input=9071b463a39a1a6a]*/
373374
{
374375
int rtn = hide_panel(self->pan);
375376
return curses_panel_panel_check_err(self, rtn, "hide_panel", "hide");

0 commit comments

Comments
 (0)