summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2024-11-08 12:23:50 (GMT)
committerGitHub <noreply@github.com>2024-11-08 12:23:50 (GMT)
commit061e50f196373d920c3eaa3718b9d0553914e006 (patch)
tree8121c12d8d17ccdd0b3a33dd7f3c93fb725f04df /Lib
parentee0746af7d7cfc6cc25441726034e4fea4bcf7e5 (diff)
downloadcpython-061e50f196373d920c3eaa3718b9d0553914e006.zip
cpython-061e50f196373d920c3eaa3718b9d0553914e006.tar.gz
cpython-061e50f196373d920c3eaa3718b9d0553914e006.tar.bz2
gh-122943: Add the varpos parameter in _PyArg_UnpackKeywords (GH-126564)
Remove _PyArg_UnpackKeywordsWithVararg. Add comments for integer arguments of _PyArg_UnpackKeywords.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/clinic.test.c155
-rw-r--r--Lib/test/test_call.py2
-rw-r--r--Lib/test/test_clinic.py2
3 files changed, 95 insertions, 64 deletions
diff --git a/Lib/test/clinic.test.c b/Lib/test/clinic.test.c
index e653052..4ad0b8b 100644
--- a/Lib/test/clinic.test.c
+++ b/Lib/test/clinic.test.c
@@ -2199,7 +2199,8 @@ test_keywords(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec
PyObject *a;
PyObject *b;
- args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 2, 0, argsbuf);
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
+ /*minpos*/ 2, /*maxpos*/ 2, /*minkw*/ 0, /*varpos*/ 0, argsbuf);
if (!args) {
goto exit;
}
@@ -2213,7 +2214,7 @@ exit:
static PyObject *
test_keywords_impl(PyObject *module, PyObject *a, PyObject *b)
-/*[clinic end generated code: output=13ba007e1c842a37 input=0d3484844749c05b]*/
+/*[clinic end generated code: output=5411fdee0a85d60d input=0d3484844749c05b]*/
/*[clinic input]
@@ -2269,7 +2270,8 @@ test_keywords_kwonly(PyObject *module, PyObject *const *args, Py_ssize_t nargs,
PyObject *a;
PyObject *b;
- args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 1, argsbuf);
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
+ /*minpos*/ 1, /*maxpos*/ 1, /*minkw*/ 1, /*varpos*/ 0, argsbuf);
if (!args) {
goto exit;
}
@@ -2283,7 +2285,7 @@ exit:
static PyObject *
test_keywords_kwonly_impl(PyObject *module, PyObject *a, PyObject *b)
-/*[clinic end generated code: output=789799a6d2d6eb4d input=384adc78bfa0bff7]*/
+/*[clinic end generated code: output=38b11b4dd0a94399 input=384adc78bfa0bff7]*/
/*[clinic input]
@@ -2342,7 +2344,8 @@ test_keywords_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyO
PyObject *b = Py_None;
PyObject *c = Py_None;
- args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 3, 0, argsbuf);
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
+ /*minpos*/ 1, /*maxpos*/ 3, /*minkw*/ 0, /*varpos*/ 0, argsbuf);
if (!args) {
goto exit;
}
@@ -2367,7 +2370,7 @@ exit:
static PyObject *
test_keywords_opt_impl(PyObject *module, PyObject *a, PyObject *b,
PyObject *c)
-/*[clinic end generated code: output=42430dd8ea5afde6 input=eda7964f784f4607]*/
+/*[clinic end generated code: output=c59ecb8eca9880cf input=eda7964f784f4607]*/
/*[clinic input]
@@ -2429,7 +2432,8 @@ test_keywords_opt_kwonly(PyObject *module, PyObject *const *args, Py_ssize_t nar
PyObject *c = Py_None;
PyObject *d = Py_None;
- args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 2, 0, argsbuf);
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
+ /*minpos*/ 1, /*maxpos*/ 2, /*minkw*/ 0, /*varpos*/ 0, argsbuf);
if (!args) {
goto exit;
}
@@ -2464,7 +2468,7 @@ exit:
static PyObject *
test_keywords_opt_kwonly_impl(PyObject *module, PyObject *a, PyObject *b,
PyObject *c, PyObject *d)
-/*[clinic end generated code: output=f312c35c380d2bf9 input=209387a4815e5082]*/
+/*[clinic end generated code: output=b9572975a3e5d857 input=209387a4815e5082]*/
/*[clinic input]
@@ -2524,7 +2528,8 @@ test_keywords_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssize_t nar
PyObject *b = Py_None;
PyObject *c = Py_None;
- args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
+ /*minpos*/ 1, /*maxpos*/ 1, /*minkw*/ 0, /*varpos*/ 0, argsbuf);
if (!args) {
goto exit;
}
@@ -2549,7 +2554,7 @@ exit:
static PyObject *
test_keywords_kwonly_opt_impl(PyObject *module, PyObject *a, PyObject *b,
PyObject *c)
-/*[clinic end generated code: output=3937da2a8233ebe0 input=18393cc64fa000f4]*/
+/*[clinic end generated code: output=94114334841ff55a input=18393cc64fa000f4]*/
/*[clinic input]
@@ -2605,7 +2610,8 @@ test_posonly_keywords(PyObject *module, PyObject *const *args, Py_ssize_t nargs,
PyObject *a;
PyObject *b;
- args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 2, 0, argsbuf);
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
+ /*minpos*/ 2, /*maxpos*/ 2, /*minkw*/ 0, /*varpos*/ 0, argsbuf);
if (!args) {
goto exit;
}
@@ -2619,7 +2625,7 @@ exit:
static PyObject *
test_posonly_keywords_impl(PyObject *module, PyObject *a, PyObject *b)
-/*[clinic end generated code: output=6b4f6dd5f4db3877 input=1767b0ebdf06060e]*/
+/*[clinic end generated code: output=4abfbb43b77fd29a input=1767b0ebdf06060e]*/
/*[clinic input]
@@ -2676,7 +2682,8 @@ test_posonly_kwonly(PyObject *module, PyObject *const *args, Py_ssize_t nargs, P
PyObject *a;
PyObject *c;
- args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 1, argsbuf);
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
+ /*minpos*/ 1, /*maxpos*/ 1, /*minkw*/ 1, /*varpos*/ 0, argsbuf);
if (!args) {
goto exit;
}
@@ -2690,7 +2697,7 @@ exit:
static PyObject *
test_posonly_kwonly_impl(PyObject *module, PyObject *a, PyObject *c)
-/*[clinic end generated code: output=8bef2a8198e70b26 input=9042f2818f664839]*/
+/*[clinic end generated code: output=9fe05c76d80d63a9 input=9042f2818f664839]*/
/*[clinic input]
@@ -2750,7 +2757,8 @@ test_posonly_keywords_kwonly(PyObject *module, PyObject *const *args, Py_ssize_t
PyObject *b;
PyObject *c;
- args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 2, 1, argsbuf);
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
+ /*minpos*/ 2, /*maxpos*/ 2, /*minkw*/ 1, /*varpos*/ 0, argsbuf);
if (!args) {
goto exit;
}
@@ -2766,7 +2774,7 @@ exit:
static PyObject *
test_posonly_keywords_kwonly_impl(PyObject *module, PyObject *a, PyObject *b,
PyObject *c)
-/*[clinic end generated code: output=a44b8ae8300955e1 input=29546ebdca492fea]*/
+/*[clinic end generated code: output=de2b8c631dc1b5d3 input=29546ebdca492fea]*/
/*[clinic input]
@@ -2828,7 +2836,8 @@ test_posonly_keywords_opt(PyObject *module, PyObject *const *args, Py_ssize_t na
PyObject *c = Py_None;
PyObject *d = Py_None;
- args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 4, 0, argsbuf);
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
+ /*minpos*/ 2, /*maxpos*/ 4, /*minkw*/ 0, /*varpos*/ 0, argsbuf);
if (!args) {
goto exit;
}
@@ -2854,7 +2863,7 @@ exit:
static PyObject *
test_posonly_keywords_opt_impl(PyObject *module, PyObject *a, PyObject *b,
PyObject *c, PyObject *d)
-/*[clinic end generated code: output=cae6647c9e8e0238 input=cdf5a9625e554e9b]*/
+/*[clinic end generated code: output=70002e6beef31864 input=cdf5a9625e554e9b]*/
/*[clinic input]
@@ -2914,7 +2923,8 @@ test_posonly_keywords_opt2(PyObject *module, PyObject *const *args, Py_ssize_t n
PyObject *b = Py_None;
PyObject *c = Py_None;
- args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 3, 0, argsbuf);
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
+ /*minpos*/ 1, /*maxpos*/ 3, /*minkw*/ 0, /*varpos*/ 0, argsbuf);
if (!args) {
goto exit;
}
@@ -2939,7 +2949,7 @@ exit:
static PyObject *
test_posonly_keywords_opt2_impl(PyObject *module, PyObject *a, PyObject *b,
PyObject *c)
-/*[clinic end generated code: output=6526fd08aafa2149 input=1581299d21d16f14]*/
+/*[clinic end generated code: output=b0f78abf242565cf input=1581299d21d16f14]*/
/*[clinic input]
@@ -3001,7 +3011,8 @@ test_posonly_opt_keywords_opt(PyObject *module, PyObject *const *args, Py_ssize_
PyObject *c = Py_None;
PyObject *d = Py_None;
- args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 4, 0, argsbuf);
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
+ /*minpos*/ 1, /*maxpos*/ 4, /*minkw*/ 0, /*varpos*/ 0, argsbuf);
if (!args) {
goto exit;
}
@@ -3032,7 +3043,7 @@ exit:
static PyObject *
test_posonly_opt_keywords_opt_impl(PyObject *module, PyObject *a,
PyObject *b, PyObject *c, PyObject *d)
-/*[clinic end generated code: output=b8d01e98443738c2 input=408798ec3d42949f]*/
+/*[clinic end generated code: output=75708b03d2837419 input=408798ec3d42949f]*/
/*[clinic input]
@@ -3095,7 +3106,8 @@ test_posonly_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssize_t narg
PyObject *c = Py_None;
PyObject *d = Py_None;
- args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 1, argsbuf);
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
+ /*minpos*/ 1, /*maxpos*/ 1, /*minkw*/ 1, /*varpos*/ 0, argsbuf);
if (!args) {
goto exit;
}
@@ -3121,7 +3133,7 @@ exit:
static PyObject *
test_posonly_kwonly_opt_impl(PyObject *module, PyObject *a, PyObject *b,
PyObject *c, PyObject *d)
-/*[clinic end generated code: output=81d71c288f13d4dc input=8d8e5643bbbc2309]*/
+/*[clinic end generated code: output=3aab93ed7b9cc713 input=8d8e5643bbbc2309]*/
/*[clinic input]
@@ -3182,7 +3194,8 @@ test_posonly_kwonly_opt2(PyObject *module, PyObject *const *args, Py_ssize_t nar
PyObject *b = Py_None;
PyObject *c = Py_None;
- args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
+ /*minpos*/ 1, /*maxpos*/ 1, /*minkw*/ 0, /*varpos*/ 0, argsbuf);
if (!args) {
goto exit;
}
@@ -3207,7 +3220,7 @@ exit:
static PyObject *
test_posonly_kwonly_opt2_impl(PyObject *module, PyObject *a, PyObject *b,
PyObject *c)
-/*[clinic end generated code: output=a717d2a1a3310289 input=f7e5eed94f75fff0]*/
+/*[clinic end generated code: output=ac73a9a84a83e0c7 input=f7e5eed94f75fff0]*/
/*[clinic input]
@@ -3270,7 +3283,8 @@ test_posonly_opt_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssize_t
PyObject *c = Py_None;
PyObject *d = Py_None;
- args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 2, 0, argsbuf);
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
+ /*minpos*/ 1, /*maxpos*/ 2, /*minkw*/ 0, /*varpos*/ 0, argsbuf);
if (!args) {
goto exit;
}
@@ -3301,7 +3315,7 @@ exit:
static PyObject *
test_posonly_opt_kwonly_opt_impl(PyObject *module, PyObject *a, PyObject *b,
PyObject *c, PyObject *d)
-/*[clinic end generated code: output=0f50b4b8d45cf2de input=1e557dc979d120fd]*/
+/*[clinic end generated code: output=21a1bfee0c50ec98 input=1e557dc979d120fd]*/
/*[clinic input]
@@ -3367,7 +3381,8 @@ test_posonly_keywords_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssi
PyObject *d = Py_None;
PyObject *e = Py_None;
- args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 2, 1, argsbuf);
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
+ /*minpos*/ 2, /*maxpos*/ 2, /*minkw*/ 1, /*varpos*/ 0, argsbuf);
if (!args) {
goto exit;
}
@@ -3395,7 +3410,7 @@ static PyObject *
test_posonly_keywords_kwonly_opt_impl(PyObject *module, PyObject *a,
PyObject *b, PyObject *c, PyObject *d,
PyObject *e)
-/*[clinic end generated code: output=8dac8d2a4e6105fa input=c3884a4f956fdc89]*/
+/*[clinic end generated code: output=60ac8589c5331fc9 input=c3884a4f956fdc89]*/
/*[clinic input]
@@ -3458,7 +3473,8 @@ test_posonly_keywords_kwonly_opt2(PyObject *module, PyObject *const *args, Py_ss
PyObject *c = Py_None;
PyObject *d = Py_None;
- args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 2, 0, argsbuf);
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
+ /*minpos*/ 2, /*maxpos*/ 2, /*minkw*/ 0, /*varpos*/ 0, argsbuf);
if (!args) {
goto exit;
}
@@ -3484,7 +3500,7 @@ exit:
static PyObject *
test_posonly_keywords_kwonly_opt2_impl(PyObject *module, PyObject *a,
PyObject *b, PyObject *c, PyObject *d)
-/*[clinic end generated code: output=5a96d521e6414f5d input=68d01d7c0f6dafb0]*/
+/*[clinic end generated code: output=349e1a19c507956a input=68d01d7c0f6dafb0]*/
/*[clinic input]
@@ -3551,7 +3567,8 @@ test_posonly_keywords_opt_kwonly_opt(PyObject *module, PyObject *const *args, Py
PyObject *d = Py_None;
PyObject *e = Py_None;
- args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 3, 0, argsbuf);
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
+ /*minpos*/ 2, /*maxpos*/ 3, /*minkw*/ 0, /*varpos*/ 0, argsbuf);
if (!args) {
goto exit;
}
@@ -3588,7 +3605,7 @@ static PyObject *
test_posonly_keywords_opt_kwonly_opt_impl(PyObject *module, PyObject *a,
PyObject *b, PyObject *c,
PyObject *d, PyObject *e)
-/*[clinic end generated code: output=d5a474dcd5dc3e9f input=d0883d45876f186c]*/
+/*[clinic end generated code: output=94787c9e20861a56 input=d0883d45876f186c]*/
/*[clinic input]
@@ -3655,7 +3672,8 @@ test_posonly_keywords_opt2_kwonly_opt(PyObject *module, PyObject *const *args, P
PyObject *d = Py_None;
PyObject *e = Py_None;
- args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 3, 0, argsbuf);
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
+ /*minpos*/ 1, /*maxpos*/ 3, /*minkw*/ 0, /*varpos*/ 0, argsbuf);
if (!args) {
goto exit;
}
@@ -3697,7 +3715,7 @@ static PyObject *
test_posonly_keywords_opt2_kwonly_opt_impl(PyObject *module, PyObject *a,
PyObject *b, PyObject *c,
PyObject *d, PyObject *e)
-/*[clinic end generated code: output=ac239c5ee8a74408 input=c95e2e1ec93035ad]*/
+/*[clinic end generated code: output=ea8664ae9fdb4769 input=c95e2e1ec93035ad]*/
/*[clinic input]
@@ -3767,7 +3785,8 @@ test_posonly_opt_keywords_opt_kwonly_opt(PyObject *module, PyObject *const *args
PyObject *e = Py_None;
PyObject *f = Py_None;
- args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 4, 0, argsbuf);
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
+ /*minpos*/ 1, /*maxpos*/ 4, /*minkw*/ 0, /*varpos*/ 0, argsbuf);
if (!args) {
goto exit;
}
@@ -3816,7 +3835,7 @@ test_posonly_opt_keywords_opt_kwonly_opt_impl(PyObject *module, PyObject *a,
PyObject *b, PyObject *c,
PyObject *d, PyObject *e,
PyObject *f)
-/*[clinic end generated code: output=638bbd0005639342 input=9914857713c5bbf8]*/
+/*[clinic end generated code: output=6e0ee12cf458acb1 input=9914857713c5bbf8]*/
/*[clinic input]
test_keyword_only_parameter
@@ -3871,7 +3890,8 @@ test_keyword_only_parameter(PyObject *module, PyObject *const *args, Py_ssize_t
Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
PyBytesObject *co_lnotab = (PyBytesObject *)self->co_lnotab;
- args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 0, 0, argsbuf);
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
+ /*minpos*/ 0, /*maxpos*/ 0, /*minkw*/ 0, /*varpos*/ 0, argsbuf);
if (!args) {
goto exit;
}
@@ -3892,7 +3912,7 @@ exit:
static PyObject *
test_keyword_only_parameter_impl(PyObject *module, PyBytesObject *co_lnotab)
-/*[clinic end generated code: output=b12fe2e515a62603 input=303df5046c7e37a3]*/
+/*[clinic end generated code: output=18b5b3c80412bc4a input=303df5046c7e37a3]*/
/*[clinic input]
@@ -4270,7 +4290,8 @@ test_vararg(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject
PyObject *a;
PyObject *__clinic_args = NULL;
- fastargs = _PyArg_UnpackKeywordsWithVararg(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ fastargs = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
+ /*minpos*/ 1, /*maxpos*/ 1, /*minkw*/ 0, /*varpos*/ 1, argsbuf);
if (!fastargs) {
goto exit;
}
@@ -4292,7 +4313,7 @@ exit:
static PyObject *
test_vararg_impl(PyObject *module, PyObject *a, PyObject *args)
-/*[clinic end generated code: output=e7d7da6a7e008125 input=7448995636d9186a]*/
+/*[clinic end generated code: output=5fa7dc68243a5211 input=7448995636d9186a]*/
/*[clinic input]
test_vararg_with_default
@@ -4352,7 +4373,8 @@ test_vararg_with_default(PyObject *module, PyObject *const *args, Py_ssize_t nar
PyObject *__clinic_args = NULL;
int b = 0;
- fastargs = _PyArg_UnpackKeywordsWithVararg(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ fastargs = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
+ /*minpos*/ 1, /*maxpos*/ 1, /*minkw*/ 0, /*varpos*/ 1, argsbuf);
if (!fastargs) {
goto exit;
}
@@ -4383,7 +4405,7 @@ exit:
static PyObject *
test_vararg_with_default_impl(PyObject *module, PyObject *a, PyObject *args,
int b)
-/*[clinic end generated code: output=46781f9920ecedcf input=3a0f9f557ce1f712]*/
+/*[clinic end generated code: output=603ae52bfa307337 input=3a0f9f557ce1f712]*/
/*[clinic input]
test_vararg_with_only_defaults
@@ -4443,7 +4465,8 @@ test_vararg_with_only_defaults(PyObject *module, PyObject *const *args, Py_ssize
int b = 0;
PyObject *c = " ";
- fastargs = _PyArg_UnpackKeywordsWithVararg(args, nargs, NULL, kwnames, &_parser, 0, 0, 0, argsbuf);
+ fastargs = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
+ /*minpos*/ 0, /*maxpos*/ 0, /*minkw*/ 0, /*varpos*/ 1, argsbuf);
if (!fastargs) {
goto exit;
}
@@ -4477,7 +4500,7 @@ exit:
static PyObject *
test_vararg_with_only_defaults_impl(PyObject *module, PyObject *args, int b,
PyObject *c)
-/*[clinic end generated code: output=d03daf5067039c03 input=6983e66817f82924]*/
+/*[clinic end generated code: output=195fe286176f4ee8 input=6983e66817f82924]*/
/*[clinic input]
test_paramname_module
@@ -4528,7 +4551,8 @@ test_paramname_module(PyObject *module, PyObject *const *args, Py_ssize_t nargs,
PyObject *argsbuf[1];
PyObject *mod;
- args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
+ /*minpos*/ 1, /*maxpos*/ 1, /*minkw*/ 0, /*varpos*/ 0, argsbuf);
if (!args) {
goto exit;
}
@@ -4541,7 +4565,7 @@ exit:
static PyObject *
test_paramname_module_impl(PyObject *module, PyObject *mod)
-/*[clinic end generated code: output=4a2a849ecbcc8b53 input=afefe259667f13ba]*/
+/*[clinic end generated code: output=7ab63a2adaea2873 input=afefe259667f13ba]*/
/*[clinic input]
mangle1
@@ -4613,7 +4637,8 @@ mangle1(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwn
PyObject *__clinic_nargs;
PyObject *__clinic_noptargs;
- args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 9, 9, 0, argsbuf);
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
+ /*minpos*/ 9, /*maxpos*/ 9, /*minkw*/ 0, /*varpos*/ 0, argsbuf);
if (!args) {
goto exit;
}
@@ -4637,7 +4662,7 @@ mangle1_impl(PyObject *module, PyObject *args, PyObject *kwnames,
PyObject *return_value, PyObject *_keywords, PyObject *_parser,
PyObject *argsbuf, PyObject *fastargs, PyObject *nargs,
PyObject *noptargs)
-/*[clinic end generated code: output=083e5076be9987c3 input=a3ed51bdedf8a3c7]*/
+/*[clinic end generated code: output=f9127cea2f508da3 input=a3ed51bdedf8a3c7]*/
/*[clinic input]
mangle2
@@ -4694,7 +4719,8 @@ mangle2(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwn
PyObject *__clinic_kwargs;
PyObject *__clinic_return_value;
- args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 3, 3, 0, argsbuf);
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
+ /*minpos*/ 3, /*maxpos*/ 3, /*minkw*/ 0, /*varpos*/ 0, argsbuf);
if (!args) {
goto exit;
}
@@ -4710,7 +4736,7 @@ exit:
static PyObject *
mangle2_impl(PyObject *module, PyObject *args, PyObject *kwargs,
PyObject *return_value)
-/*[clinic end generated code: output=2ebb62aaefe7590a input=391766fee51bad7a]*/
+/*[clinic end generated code: output=3afbc3260971e5d3 input=391766fee51bad7a]*/
/*[clinic input]
@@ -4763,7 +4789,8 @@ Test_cls_with_param(TestObj *self, PyTypeObject *cls, PyObject *const *args, Py_
PyObject *argsbuf[1];
int a;
- args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
+ /*minpos*/ 1, /*maxpos*/ 1, /*minkw*/ 0, /*varpos*/ 0, argsbuf);
if (!args) {
goto exit;
}
@@ -4779,7 +4806,7 @@ exit:
static PyObject *
Test_cls_with_param_impl(TestObj *self, PyTypeObject *cls, int a)
-/*[clinic end generated code: output=a3a968137b0f320a input=af158077bd237ef9]*/
+/*[clinic end generated code: output=83a391eea66d08f8 input=af158077bd237ef9]*/
/*[clinic input]
@@ -5174,7 +5201,8 @@ Test___init__(PyObject *self, PyObject *args, PyObject *kwargs)
Py_ssize_t nargs = PyTuple_GET_SIZE(args);
PyObject *a;
- fastargs = _PyArg_UnpackKeywords(_PyTuple_CAST(args)->ob_item, nargs, kwargs, NULL, &_parser, 1, 1, 0, argsbuf);
+ fastargs = _PyArg_UnpackKeywords(_PyTuple_CAST(args)->ob_item, nargs, kwargs, NULL, &_parser,
+ /*minpos*/ 1, /*maxpos*/ 1, /*minkw*/ 0, /*varpos*/ 0, argsbuf);
if (!fastargs) {
goto exit;
}
@@ -5187,7 +5215,7 @@ exit:
static int
Test___init___impl(TestObj *self, PyObject *a)
-/*[clinic end generated code: output=0e1239b9bc247bc1 input=a8f9222a6ab35c59]*/
+/*[clinic end generated code: output=aa1f3d73e611e438 input=a8f9222a6ab35c59]*/
/*[clinic input]
@@ -5440,7 +5468,8 @@ mangled_c_keyword_identifier(PyObject *module, PyObject *const *args, Py_ssize_t
PyObject *argsbuf[1];
int int_value;
- args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
+ /*minpos*/ 1, /*maxpos*/ 1, /*minkw*/ 0, /*varpos*/ 0, argsbuf);
if (!args) {
goto exit;
}
@@ -5456,7 +5485,7 @@ exit:
static PyObject *
mangled_c_keyword_identifier_impl(PyObject *module, int int_value)
-/*[clinic end generated code: output=01a8088b57632916 input=060876448ab567a2]*/
+/*[clinic end generated code: output=19ec1a02f0819cf7 input=060876448ab567a2]*/
/*[clinic input]
@@ -5699,7 +5728,8 @@ fn_with_default_binop_expr(PyObject *module, PyObject *const *args, Py_ssize_t n
Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
PyObject *arg = CONST_A + CONST_B;
- args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
+ /*minpos*/ 0, /*maxpos*/ 1, /*minkw*/ 0, /*varpos*/ 0, argsbuf);
if (!args) {
goto exit;
}
@@ -5716,7 +5746,7 @@ exit:
static PyObject *
fn_with_default_binop_expr_impl(PyObject *module, PyObject *arg)
-/*[clinic end generated code: output=018672772e4092ff input=1b55c8ae68d89453]*/
+/*[clinic end generated code: output=e15a6f5d9f7bea0c input=1b55c8ae68d89453]*/
/*[python input]
@@ -5787,7 +5817,8 @@ docstr_fallback_to_converter_default(PyObject *module, PyObject *const *args, Py
PyObject *argsbuf[1];
str a;
- args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
+ /*minpos*/ 1, /*maxpos*/ 1, /*minkw*/ 0, /*varpos*/ 0, argsbuf);
if (!args) {
goto exit;
}
@@ -5802,7 +5833,7 @@ exit:
static PyObject *
docstr_fallback_to_converter_default_impl(PyObject *module, str a)
-/*[clinic end generated code: output=3fff7b702f0065cb input=0cbe6a4d24bc2274]*/
+/*[clinic end generated code: output=15bc9f32945ed0da input=0cbe6a4d24bc2274]*/
/*[clinic input]
diff --git a/Lib/test/test_call.py b/Lib/test/test_call.py
index 68e3b2a..9d5256b 100644
--- a/Lib/test/test_call.py
+++ b/Lib/test/test_call.py
@@ -168,7 +168,7 @@ class CFunctionCallsErrorMessages(unittest.TestCase):
print, 0, sep=1, end=2, file=3, flush=4, foo=5)
def test_varargs18_kw(self):
- # _PyArg_UnpackKeywordsWithVararg()
+ # _PyArg_UnpackKeywords() with varpos
msg = r"invalid keyword argument for print\(\)$"
with self.assertRaisesRegex(TypeError, msg):
print(0, 1, **{BadStr('foo'): ','})
diff --git a/Lib/test/test_clinic.py b/Lib/test/test_clinic.py
index 3936acd..1105496 100644
--- a/Lib/test/test_clinic.py
+++ b/Lib/test/test_clinic.py
@@ -2703,7 +2703,7 @@ class ClinicExternalTest(TestCase):
# Verify by checking the checksum.
checksum = (
"/*[clinic end generated code: "
- "output=0acbef4794cb933e input=9543a8d2da235301]*/\n"
+ "output=00512eb783a9b748 input=9543a8d2da235301]*/\n"
)
with open(fn, encoding='utf-8') as f:
generated = f.read()