Skip to content

Commit 89964c4

Browse files
committed
Issue python#23944: Argument Clinic now wraps long impl prototypes at column 78.
1 parent 687592d commit 89964c4

38 files changed

+537
-280
lines changed

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,8 @@ Tests
162162
Tools/Demos
163163
-----------
164164

165+
- Issue #23944: Argument Clinic now wraps long impl prototypes at column 78.
166+
165167
- Issue #20586: Argument Clinic now ensures that functions without docstrings
166168
have signatures.
167169

Modules/_bz2module.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -614,8 +614,9 @@ the unused_data attribute.
614614
[clinic start generated code]*/
615615

616616
static PyObject *
617-
_bz2_BZ2Decompressor_decompress_impl(BZ2Decompressor *self, Py_buffer *data, Py_ssize_t max_length)
618-
/*[clinic end generated code: output=7eeb5794035a2ca3 input=9558b424c8b00516]*/
617+
_bz2_BZ2Decompressor_decompress_impl(BZ2Decompressor *self, Py_buffer *data,
618+
Py_ssize_t max_length)
619+
/*[clinic end generated code: output=23e41045deb240a3 input=9558b424c8b00516]*/
619620
{
620621
PyObject *result = NULL;
621622

Modules/_cursesmodule.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -586,8 +586,9 @@ current settings for the window object.
586586
[clinic start generated code]*/
587587

588588
static PyObject *
589-
curses_window_addch_impl(PyCursesWindowObject *self, int group_left_1, int y, int x, PyObject *ch, int group_right_1, long attr)
590-
/*[clinic end generated code: output=9fa34a5d80151f1a input=5a41efb34a2de338]*/
589+
curses_window_addch_impl(PyCursesWindowObject *self, int group_left_1, int y,
590+
int x, PyObject *ch, int group_right_1, long attr)
591+
/*[clinic end generated code: output=99f7f85078ec06c3 input=5a41efb34a2de338]*/
591592
{
592593
PyCursesWindowObject *cwself = (PyCursesWindowObject *)self;
593594
int coordinates_group = group_left_1;

Modules/_dbmmodule.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,9 @@ Return the value for key if present, otherwise default.
280280
[clinic start generated code]*/
281281

282282
static PyObject *
283-
dbm_dbm_get_impl(dbmobject *dp, const char *key, Py_ssize_clean_t key_length, PyObject *default_value)
284-
/*[clinic end generated code: output=c2bdccaa734ad349 input=aecf5efd2f2b1a3b]*/
283+
dbm_dbm_get_impl(dbmobject *dp, const char *key, Py_ssize_clean_t key_length,
284+
PyObject *default_value)
285+
/*[clinic end generated code: output=4f5c0e523eaf1251 input=aecf5efd2f2b1a3b]*/
285286
{
286287
datum dbm_key, val;
287288

@@ -422,8 +423,9 @@ Return a database object.
422423
[clinic start generated code]*/
423424

424425
static PyObject *
425-
dbmopen_impl(PyModuleDef *module, const char *filename, const char *flags, int mode)
426-
/*[clinic end generated code: output=8b618fe06b92bf86 input=6499ab0fab1333ac]*/
426+
dbmopen_impl(PyModuleDef *module, const char *filename, const char *flags,
427+
int mode)
428+
/*[clinic end generated code: output=e8d4b36f25c733fd input=6499ab0fab1333ac]*/
427429
{
428430
int iflags;
429431

Modules/_lzmamodule.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,8 +1085,9 @@ the unused_data attribute.
10851085
[clinic start generated code]*/
10861086

10871087
static PyObject *
1088-
_lzma_LZMADecompressor_decompress_impl(Decompressor *self, Py_buffer *data, Py_ssize_t max_length)
1089-
/*[clinic end generated code: output=1532a5bb23629001 input=f2bb902cc1caf203]*/
1088+
_lzma_LZMADecompressor_decompress_impl(Decompressor *self, Py_buffer *data,
1089+
Py_ssize_t max_length)
1090+
/*[clinic end generated code: output=ef4e20ec7122241d input=f2bb902cc1caf203]*/
10901091
{
10911092
PyObject *result = NULL;
10921093

@@ -1150,8 +1151,9 @@ For one-shot decompression, use the decompress() function instead.
11501151
[clinic start generated code]*/
11511152

11521153
static int
1153-
_lzma_LZMADecompressor___init___impl(Decompressor *self, int format, PyObject *memlimit, PyObject *filters)
1154-
/*[clinic end generated code: output=9b119f6f2cc2d7a8 input=458ca6132ef29801]*/
1154+
_lzma_LZMADecompressor___init___impl(Decompressor *self, int format,
1155+
PyObject *memlimit, PyObject *filters)
1156+
/*[clinic end generated code: output=3e1821f8aa36564c input=458ca6132ef29801]*/
11551157
{
11561158
const uint32_t decoder_flags = LZMA_TELL_ANY_CHECK | LZMA_TELL_NO_CHECK;
11571159
uint64_t memlimit_ = UINT64_MAX;
@@ -1399,8 +1401,9 @@ The result does not include the filter ID itself, only the options.
13991401
[clinic start generated code]*/
14001402

14011403
static PyObject *
1402-
_lzma__decode_filter_properties_impl(PyModuleDef *module, lzma_vli filter_id, Py_buffer *encoded_props)
1403-
/*[clinic end generated code: output=235f7f5345d48744 input=246410800782160c]*/
1404+
_lzma__decode_filter_properties_impl(PyModuleDef *module, lzma_vli filter_id,
1405+
Py_buffer *encoded_props)
1406+
/*[clinic end generated code: output=af248f570746668b input=246410800782160c]*/
14041407
{
14051408
lzma_filter filter;
14061409
lzma_ret lzret;

Modules/_pickle.c

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4106,8 +4106,9 @@ to map the new Python 3 names to the old module names used in Python
41064106
[clinic start generated code]*/
41074107

41084108
static int
4109-
_pickle_Pickler___init___impl(PicklerObject *self, PyObject *file, PyObject *protocol, int fix_imports)
4110-
/*[clinic end generated code: output=56e229f3b1f4332f input=b8cdeb7e3f5ee674]*/
4109+
_pickle_Pickler___init___impl(PicklerObject *self, PyObject *file,
4110+
PyObject *protocol, int fix_imports)
4111+
/*[clinic end generated code: output=b5f31078dab17fb0 input=b8cdeb7e3f5ee674]*/
41114112
{
41124113
_Py_IDENTIFIER(persistent_id);
41134114
_Py_IDENTIFIER(dispatch_table);
@@ -6302,8 +6303,10 @@ needed. Both arguments passed are str objects.
63026303
[clinic start generated code]*/
63036304

63046305
static PyObject *
6305-
_pickle_Unpickler_find_class_impl(UnpicklerObject *self, PyObject *module_name, PyObject *global_name)
6306-
/*[clinic end generated code: output=64c77437e088e188 input=e2e6a865de093ef4]*/
6306+
_pickle_Unpickler_find_class_impl(UnpicklerObject *self,
6307+
PyObject *module_name,
6308+
PyObject *global_name)
6309+
/*[clinic end generated code: output=becc08d7f9ed41e3 input=e2e6a865de093ef4]*/
63076310
{
63086311
PyObject *global;
63096312
PyObject *modules_dict;
@@ -6514,8 +6517,10 @@ string instances as bytes objects.
65146517
[clinic start generated code]*/
65156518

65166519
static int
6517-
_pickle_Unpickler___init___impl(UnpicklerObject *self, PyObject *file, int fix_imports, const char *encoding, const char *errors)
6518-
/*[clinic end generated code: output=b9ed1d84d315f3b5 input=30b4dc9e976b890c]*/
6520+
_pickle_Unpickler___init___impl(UnpicklerObject *self, PyObject *file,
6521+
int fix_imports, const char *encoding,
6522+
const char *errors)
6523+
/*[clinic end generated code: output=e2c8ce748edc57b0 input=30b4dc9e976b890c]*/
65196524
{
65206525
_Py_IDENTIFIER(persistent_load);
65216526

@@ -6943,8 +6948,9 @@ to map the new Python 3 names to the old module names used in Python
69436948
[clinic start generated code]*/
69446949

69456950
static PyObject *
6946-
_pickle_dump_impl(PyModuleDef *module, PyObject *obj, PyObject *file, PyObject *protocol, int fix_imports)
6947-
/*[clinic end generated code: output=a606e626d553850d input=e9e5fdd48de92eae]*/
6951+
_pickle_dump_impl(PyModuleDef *module, PyObject *obj, PyObject *file,
6952+
PyObject *protocol, int fix_imports)
6953+
/*[clinic end generated code: output=0de7dff89c406816 input=e9e5fdd48de92eae]*/
69486954
{
69496955
PicklerObject *pickler = _Pickler_New();
69506956

@@ -6996,8 +7002,9 @@ Python 2, so that the pickle data stream is readable with Python 2.
69967002
[clinic start generated code]*/
69977003

69987004
static PyObject *
6999-
_pickle_dumps_impl(PyModuleDef *module, PyObject *obj, PyObject *protocol, int fix_imports)
7000-
/*[clinic end generated code: output=777f0deefe5b88ee input=293dbeda181580b7]*/
7005+
_pickle_dumps_impl(PyModuleDef *module, PyObject *obj, PyObject *protocol,
7006+
int fix_imports)
7007+
/*[clinic end generated code: output=daa380db56fe07b9 input=293dbeda181580b7]*/
70017008
{
70027009
PyObject *result;
70037010
PicklerObject *pickler = _Pickler_New();
@@ -7056,8 +7063,9 @@ string instances as bytes objects.
70567063
[clinic start generated code]*/
70577064

70587065
static PyObject *
7059-
_pickle_load_impl(PyModuleDef *module, PyObject *file, int fix_imports, const char *encoding, const char *errors)
7060-
/*[clinic end generated code: output=568c61356c172654 input=da97372e38e510a6]*/
7066+
_pickle_load_impl(PyModuleDef *module, PyObject *file, int fix_imports,
7067+
const char *encoding, const char *errors)
7068+
/*[clinic end generated code: output=798f1c57cb2b4eb1 input=da97372e38e510a6]*/
70617069
{
70627070
PyObject *result;
70637071
UnpicklerObject *unpickler = _Unpickler_New();
@@ -7109,8 +7117,9 @@ string instances as bytes objects.
71097117
[clinic start generated code]*/
71107118

71117119
static PyObject *
7112-
_pickle_loads_impl(PyModuleDef *module, PyObject *data, int fix_imports, const char *encoding, const char *errors)
7113-
/*[clinic end generated code: output=0b3845ad110b2522 input=f57f0fdaa2b4cb8b]*/
7120+
_pickle_loads_impl(PyModuleDef *module, PyObject *data, int fix_imports,
7121+
const char *encoding, const char *errors)
7122+
/*[clinic end generated code: output=61e9cdb01e36a736 input=f57f0fdaa2b4cb8b]*/
71147123
{
71157124
PyObject *result;
71167125
UnpicklerObject *unpickler = _Unpickler_New();

Modules/arraymodule.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1684,8 +1684,9 @@ some other type.
16841684
[clinic start generated code]*/
16851685

16861686
static PyObject *
1687-
array_array_fromunicode_impl(arrayobject *self, Py_UNICODE *ustr, Py_ssize_clean_t ustr_length)
1688-
/*[clinic end generated code: output=3b3f4f133bac725e input=56bcedb5ef70139f]*/
1687+
array_array_fromunicode_impl(arrayobject *self, Py_UNICODE *ustr,
1688+
Py_ssize_clean_t ustr_length)
1689+
/*[clinic end generated code: output=ebb72fc16975e06d input=56bcedb5ef70139f]*/
16891690
{
16901691
char typecode;
16911692

@@ -1937,8 +1938,11 @@ Internal. Used for pickling support.
19371938
[clinic start generated code]*/
19381939

19391940
static PyObject *
1940-
array__array_reconstructor_impl(PyModuleDef *module, PyTypeObject *arraytype, int typecode, enum machine_format_code mformat_code, PyObject *items)
1941-
/*[clinic end generated code: output=c51081ec91caf7e9 input=f72492708c0a1d50]*/
1941+
array__array_reconstructor_impl(PyModuleDef *module, PyTypeObject *arraytype,
1942+
int typecode,
1943+
enum machine_format_code mformat_code,
1944+
PyObject *items)
1945+
/*[clinic end generated code: output=6ecbf0e8e4d92ab9 input=f72492708c0a1d50]*/
19421946
{
19431947
PyObject *converted_items;
19441948
PyObject *result;

Modules/audioop.c

Lines changed: 40 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -407,8 +407,9 @@ Return the value of sample index from the fragment.
407407
[clinic start generated code]*/
408408

409409
static PyObject *
410-
audioop_getsample_impl(PyModuleDef *module, Py_buffer *fragment, int width, Py_ssize_t index)
411-
/*[clinic end generated code: output=f4482497e6f6e78f input=88edbe2871393549]*/
410+
audioop_getsample_impl(PyModuleDef *module, Py_buffer *fragment, int width,
411+
Py_ssize_t index)
412+
/*[clinic end generated code: output=3995e189fdc8ec16 input=88edbe2871393549]*/
412413
{
413414
int val;
414415

@@ -593,8 +594,9 @@ Try to match reference as well as possible to a portion of fragment.
593594
[clinic start generated code]*/
594595

595596
static PyObject *
596-
audioop_findfit_impl(PyModuleDef *module, Py_buffer *fragment, Py_buffer *reference)
597-
/*[clinic end generated code: output=505fd04d4244db31 input=62c305605e183c9a]*/
597+
audioop_findfit_impl(PyModuleDef *module, Py_buffer *fragment,
598+
Py_buffer *reference)
599+
/*[clinic end generated code: output=609eedf5d823d6dd input=62c305605e183c9a]*/
598600
{
599601
const short *cp1, *cp2;
600602
Py_ssize_t len1, len2;
@@ -661,8 +663,9 @@ Return a factor F such that rms(add(fragment, mul(reference, -F))) is minimal.
661663
[clinic start generated code]*/
662664

663665
static PyObject *
664-
audioop_findfactor_impl(PyModuleDef *module, Py_buffer *fragment, Py_buffer *reference)
665-
/*[clinic end generated code: output=ddf35a1e57575ce4 input=816680301d012b21]*/
666+
audioop_findfactor_impl(PyModuleDef *module, Py_buffer *fragment,
667+
Py_buffer *reference)
668+
/*[clinic end generated code: output=5566a8c55de54f99 input=816680301d012b21]*/
666669
{
667670
const short *cp1, *cp2;
668671
Py_ssize_t len;
@@ -702,8 +705,9 @@ Search fragment for a slice of specified number of samples with maximum energy.
702705
[clinic start generated code]*/
703706

704707
static PyObject *
705-
audioop_findmax_impl(PyModuleDef *module, Py_buffer *fragment, Py_ssize_t length)
706-
/*[clinic end generated code: output=21d0c2a1e5655134 input=2f304801ed42383c]*/
708+
audioop_findmax_impl(PyModuleDef *module, Py_buffer *fragment,
709+
Py_ssize_t length)
710+
/*[clinic end generated code: output=01fe796fad2573bb input=2f304801ed42383c]*/
707711
{
708712
const short *cp1;
709713
Py_ssize_t len1;
@@ -896,8 +900,9 @@ Return a fragment that has all samples in the original fragment multiplied by th
896900
[clinic start generated code]*/
897901

898902
static PyObject *
899-
audioop_mul_impl(PyModuleDef *module, Py_buffer *fragment, int width, double factor)
900-
/*[clinic end generated code: output=a697ebbd5852d38f input=c726667baa157d3c]*/
903+
audioop_mul_impl(PyModuleDef *module, Py_buffer *fragment, int width,
904+
double factor)
905+
/*[clinic end generated code: output=1c7c31191ac86b10 input=c726667baa157d3c]*/
901906
{
902907
signed char *ncp;
903908
Py_ssize_t i;
@@ -937,8 +942,9 @@ Convert a stereo fragment to a mono fragment.
937942
[clinic start generated code]*/
938943

939944
static PyObject *
940-
audioop_tomono_impl(PyModuleDef *module, Py_buffer *fragment, int width, double lfactor, double rfactor)
941-
/*[clinic end generated code: output=436e7710521661dd input=c4ec949b3f4dddfa]*/
945+
audioop_tomono_impl(PyModuleDef *module, Py_buffer *fragment, int width,
946+
double lfactor, double rfactor)
947+
/*[clinic end generated code: output=553f547c5e29e3b6 input=c4ec949b3f4dddfa]*/
942948
{
943949
signed char *cp, *ncp;
944950
Py_ssize_t len, i;
@@ -985,8 +991,9 @@ Generate a stereo fragment from a mono fragment.
985991
[clinic start generated code]*/
986992

987993
static PyObject *
988-
audioop_tostereo_impl(PyModuleDef *module, Py_buffer *fragment, int width, double lfactor, double rfactor)
989-
/*[clinic end generated code: output=6ff50681c87f4c1c input=27b6395ebfdff37a]*/
994+
audioop_tostereo_impl(PyModuleDef *module, Py_buffer *fragment, int width,
995+
double lfactor, double rfactor)
996+
/*[clinic end generated code: output=697bb6ba41e9dd2c input=27b6395ebfdff37a]*/
990997
{
991998
signed char *ncp;
992999
Py_ssize_t i;
@@ -1032,8 +1039,9 @@ Return a fragment which is the addition of the two samples passed as parameters.
10321039
[clinic start generated code]*/
10331040

10341041
static PyObject *
1035-
audioop_add_impl(PyModuleDef *module, Py_buffer *fragment1, Py_buffer *fragment2, int width)
1036-
/*[clinic end generated code: output=f9218bf9ea75c3f1 input=4a8d4bae4c1605c7]*/
1042+
audioop_add_impl(PyModuleDef *module, Py_buffer *fragment1,
1043+
Py_buffer *fragment2, int width)
1044+
/*[clinic end generated code: output=fe6c12f143e0b027 input=4a8d4bae4c1605c7]*/
10371045
{
10381046
signed char *ncp;
10391047
Py_ssize_t i;
@@ -1090,8 +1098,9 @@ Return a fragment that is the original fragment with a bias added to each sample
10901098
[clinic start generated code]*/
10911099

10921100
static PyObject *
1093-
audioop_bias_impl(PyModuleDef *module, Py_buffer *fragment, int width, int bias)
1094-
/*[clinic end generated code: output=8ec80b3f5d510a51 input=2b5cce5c3bb4838c]*/
1101+
audioop_bias_impl(PyModuleDef *module, Py_buffer *fragment, int width,
1102+
int bias)
1103+
/*[clinic end generated code: output=ac1f4dda20a01c26 input=2b5cce5c3bb4838c]*/
10951104
{
10961105
signed char *ncp;
10971106
Py_ssize_t i;
@@ -1217,8 +1226,9 @@ Convert samples between 1-, 2-, 3- and 4-byte formats.
12171226
[clinic start generated code]*/
12181227

12191228
static PyObject *
1220-
audioop_lin2lin_impl(PyModuleDef *module, Py_buffer *fragment, int width, int newwidth)
1221-
/*[clinic end generated code: output=3f9468a74472a93e input=5ce08c8aa2f24d96]*/
1229+
audioop_lin2lin_impl(PyModuleDef *module, Py_buffer *fragment, int width,
1230+
int newwidth)
1231+
/*[clinic end generated code: output=cb6ca950d1df9898 input=5ce08c8aa2f24d96]*/
12221232
{
12231233
unsigned char *ncp;
12241234
Py_ssize_t i, j;
@@ -1274,8 +1284,10 @@ Convert the frame rate of the input fragment.
12741284
[clinic start generated code]*/
12751285

12761286
static PyObject *
1277-
audioop_ratecv_impl(PyModuleDef *module, Py_buffer *fragment, int width, int nchannels, int inrate, int outrate, PyObject *state, int weightA, int weightB)
1278-
/*[clinic end generated code: output=5585dddc4b5ff236 input=aff3acdc94476191]*/
1287+
audioop_ratecv_impl(PyModuleDef *module, Py_buffer *fragment, int width,
1288+
int nchannels, int inrate, int outrate, PyObject *state,
1289+
int weightA, int weightB)
1290+
/*[clinic end generated code: output=59e1787bfa49b9d9 input=aff3acdc94476191]*/
12791291
{
12801292
char *cp, *ncp;
12811293
Py_ssize_t len;
@@ -1601,8 +1613,9 @@ Convert samples to 4 bit Intel/DVI ADPCM encoding.
16011613
[clinic start generated code]*/
16021614

16031615
static PyObject *
1604-
audioop_lin2adpcm_impl(PyModuleDef *module, Py_buffer *fragment, int width, PyObject *state)
1605-
/*[clinic end generated code: output=4654c29d2731fafe input=12919d549b90c90a]*/
1616+
audioop_lin2adpcm_impl(PyModuleDef *module, Py_buffer *fragment, int width,
1617+
PyObject *state)
1618+
/*[clinic end generated code: output=93f0996f592b5ce5 input=12919d549b90c90a]*/
16061619
{
16071620
signed char *ncp;
16081621
Py_ssize_t i;
@@ -1723,8 +1736,9 @@ Decode an Intel/DVI ADPCM coded fragment to a linear fragment.
17231736
[clinic start generated code]*/
17241737

17251738
static PyObject *
1726-
audioop_adpcm2lin_impl(PyModuleDef *module, Py_buffer *fragment, int width, PyObject *state)
1727-
/*[clinic end generated code: output=371965cdcc0aa69b input=f5221144f5ca9ef0]*/
1739+
audioop_adpcm2lin_impl(PyModuleDef *module, Py_buffer *fragment, int width,
1740+
PyObject *state)
1741+
/*[clinic end generated code: output=236cf6dc2c829181 input=f5221144f5ca9ef0]*/
17281742
{
17291743
signed char *cp;
17301744
signed char *ncp;

Modules/binascii.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1381,8 +1381,9 @@ are both encoded. When quotetabs is set, space and tabs are encoded.
13811381
[clinic start generated code]*/
13821382

13831383
static PyObject *
1384-
binascii_b2a_qp_impl(PyModuleDef *module, Py_buffer *data, int quotetabs, int istext, int header)
1385-
/*[clinic end generated code: output=ff2991ba640fff3e input=7f2a9aaa008e92b2]*/
1384+
binascii_b2a_qp_impl(PyModuleDef *module, Py_buffer *data, int quotetabs,
1385+
int istext, int header)
1386+
/*[clinic end generated code: output=a87ca9ccb94e2a9f input=7f2a9aaa008e92b2]*/
13861387
{
13871388
Py_ssize_t in, out;
13881389
unsigned char *databuf, *odata;

0 commit comments

Comments
 (0)