gh-137609: Change names of some positional-only parameters in builtins (GH-137611)

This is for a pair with GH-137610.
This commit is contained in:
Serhiy Storchaka 2025-08-25 15:36:06 +03:00 committed by GitHub
parent 65fb4d11a0
commit b8c90e72b3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 42 additions and 42 deletions

View file

@ -82,7 +82,7 @@ exit:
}
PyDoc_STRVAR(reversed_new__doc__,
"reversed(sequence, /)\n"
"reversed(object, /)\n"
"--\n"
"\n"
"Return a reverse iterator over the values of the given sequence.");
@ -110,4 +110,4 @@ reversed_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
exit:
return return_value;
}
/*[clinic end generated code: output=3300305b351674d3 input=a9049054013a1b77]*/
/*[clinic end generated code: output=155cc9483d5f9eab input=a9049054013a1b77]*/

View file

@ -367,7 +367,7 @@ typedef struct {
@classmethod
reversed.__new__ as reversed_new
sequence as seq: object
object as seq: object
/
Return a reverse iterator over the values of the given sequence.
@ -375,7 +375,7 @@ Return a reverse iterator over the values of the given sequence.
static PyObject *
reversed_new_impl(PyTypeObject *type, PyObject *seq)
/*[clinic end generated code: output=f7854cc1df26f570 input=aeb720361e5e3f1d]*/
/*[clinic end generated code: output=f7854cc1df26f570 input=4781869729e3ba50]*/
{
Py_ssize_t n;
PyObject *reversed_meth;

View file

@ -290,17 +290,17 @@ builtin___import___impl(PyObject *module, PyObject *name, PyObject *globals,
/*[clinic input]
abs as builtin_abs
x: object
number: object
/
Return the absolute value of the argument.
[clinic start generated code]*/
static PyObject *
builtin_abs(PyObject *module, PyObject *x)
/*[clinic end generated code: output=b1b433b9e51356f5 input=bed4ca14e29c20d1]*/
builtin_abs(PyObject *module, PyObject *number)
/*[clinic end generated code: output=861a9db97dee0595 input=a356196903543505]*/
{
return PyNumber_Absolute(x);
return PyNumber_Absolute(number);
}
/*[clinic input]
@ -426,7 +426,7 @@ builtin_ascii(PyObject *module, PyObject *obj)
/*[clinic input]
bin as builtin_bin
number: object
integer: object
/
Return the binary representation of an integer.
@ -436,10 +436,10 @@ Return the binary representation of an integer.
[clinic start generated code]*/
static PyObject *
builtin_bin(PyObject *module, PyObject *number)
/*[clinic end generated code: output=b6fc4ad5e649f4f7 input=53f8a0264bacaf90]*/
builtin_bin(PyObject *module, PyObject *integer)
/*[clinic end generated code: output=533f9388441805cc input=d16518f148341e70]*/
{
return PyNumber_ToBase(number, 2);
return PyNumber_ToBase(integer, 2);
}
@ -1780,7 +1780,7 @@ builtin_hash(PyObject *module, PyObject *obj)
/*[clinic input]
hex as builtin_hex
number: object
integer: object
/
Return the hexadecimal representation of an integer.
@ -1790,10 +1790,10 @@ Return the hexadecimal representation of an integer.
[clinic start generated code]*/
static PyObject *
builtin_hex(PyObject *module, PyObject *number)
/*[clinic end generated code: output=e46b612169099408 input=e645aff5fc7d540e]*/
builtin_hex(PyObject *module, PyObject *integer)
/*[clinic end generated code: output=e5de857ba61aae08 input=3bef4746efc62fac]*/
{
return PyNumber_ToBase(number, 16);
return PyNumber_ToBase(integer, 16);
}
@ -1847,7 +1847,7 @@ PyObject *PyAnextAwaitable_New(PyObject *, PyObject *);
/*[clinic input]
anext as builtin_anext
aiterator: object
async_iterator as aiterator: object
default: object = NULL
/
@ -1860,7 +1860,7 @@ it is returned instead of raising StopAsyncIteration.
static PyObject *
builtin_anext_impl(PyObject *module, PyObject *aiterator,
PyObject *default_value)
/*[clinic end generated code: output=f02c060c163a81fa input=2900e4a370d39550]*/
/*[clinic end generated code: output=f02c060c163a81fa input=f3dc5a93f073e5ac]*/
{
PyTypeObject *t;
PyObject *awaitable;
@ -2099,7 +2099,7 @@ With two or more positional arguments, return the largest argument.");
/*[clinic input]
oct as builtin_oct
number: object
integer: object
/
Return the octal representation of an integer.
@ -2109,10 +2109,10 @@ Return the octal representation of an integer.
[clinic start generated code]*/
static PyObject *
builtin_oct(PyObject *module, PyObject *number)
/*[clinic end generated code: output=40a34656b6875352 input=ad6b274af4016c72]*/
builtin_oct(PyObject *module, PyObject *integer)
/*[clinic end generated code: output=8c15f2145a74c390 input=b97c377b15fedf8d]*/
{
return PyNumber_ToBase(number, 8);
return PyNumber_ToBase(integer, 8);
}
@ -2199,7 +2199,7 @@ builtin_pow_impl(PyObject *module, PyObject *base, PyObject *exp,
/*[clinic input]
print as builtin_print
*args: array
*objects: array
sep: object(c_default="Py_None") = ' '
string inserted between values, default a space.
end: object(c_default="Py_None") = '\n'
@ -2214,10 +2214,10 @@ Prints the values to a stream, or to sys.stdout by default.
[clinic start generated code]*/
static PyObject *
builtin_print_impl(PyObject *module, PyObject * const *args,
Py_ssize_t args_length, PyObject *sep, PyObject *end,
builtin_print_impl(PyObject *module, PyObject * const *objects,
Py_ssize_t objects_length, PyObject *sep, PyObject *end,
PyObject *file, int flush)
/*[clinic end generated code: output=3cb7e5b66f1a8547 input=66ea4de1605a2437]*/
/*[clinic end generated code: output=38d8def56c837bcc input=ff35cb3d59ee8115]*/
{
int i, err;
@ -2258,7 +2258,7 @@ builtin_print_impl(PyObject *module, PyObject * const *args,
return NULL;
}
for (i = 0; i < args_length; i++) {
for (i = 0; i < objects_length; i++) {
if (i > 0) {
if (sep == NULL) {
err = PyFile_WriteString(" ", file);
@ -2271,7 +2271,7 @@ builtin_print_impl(PyObject *module, PyObject * const *args,
return NULL;
}
}
err = PyFile_WriteObject(args[i], file, Py_PRINT_RAW);
err = PyFile_WriteObject(objects[i], file, Py_PRINT_RAW);
if (err) {
Py_DECREF(file);
return NULL;

View file

@ -114,7 +114,7 @@ exit:
}
PyDoc_STRVAR(builtin_abs__doc__,
"abs($module, x, /)\n"
"abs($module, number, /)\n"
"--\n"
"\n"
"Return the absolute value of the argument.");
@ -159,7 +159,7 @@ PyDoc_STRVAR(builtin_ascii__doc__,
{"ascii", (PyCFunction)builtin_ascii, METH_O, builtin_ascii__doc__},
PyDoc_STRVAR(builtin_bin__doc__,
"bin($module, number, /)\n"
"bin($module, integer, /)\n"
"--\n"
"\n"
"Return the binary representation of an integer.\n"
@ -729,7 +729,7 @@ PyDoc_STRVAR(builtin_hash__doc__,
{"hash", (PyCFunction)builtin_hash, METH_O, builtin_hash__doc__},
PyDoc_STRVAR(builtin_hex__doc__,
"hex($module, number, /)\n"
"hex($module, integer, /)\n"
"--\n"
"\n"
"Return the hexadecimal representation of an integer.\n"
@ -750,7 +750,7 @@ PyDoc_STRVAR(builtin_aiter__doc__,
{"aiter", (PyCFunction)builtin_aiter, METH_O, builtin_aiter__doc__},
PyDoc_STRVAR(builtin_anext__doc__,
"anext($module, aiterator, default=<unrepresentable>, /)\n"
"anext($module, async_iterator, default=<unrepresentable>, /)\n"
"--\n"
"\n"
"Return the next item from the async iterator.\n"
@ -819,7 +819,7 @@ builtin_locals(PyObject *module, PyObject *Py_UNUSED(ignored))
}
PyDoc_STRVAR(builtin_oct__doc__,
"oct($module, number, /)\n"
"oct($module, integer, /)\n"
"--\n"
"\n"
"Return the octal representation of an integer.\n"
@ -917,7 +917,7 @@ exit:
}
PyDoc_STRVAR(builtin_print__doc__,
"print($module, /, *args, sep=\' \', end=\'\\n\', file=None, flush=False)\n"
"print($module, /, *objects, sep=\' \', end=\'\\n\', file=None, flush=False)\n"
"--\n"
"\n"
"Prints the values to a stream, or to sys.stdout by default.\n"
@ -935,8 +935,8 @@ PyDoc_STRVAR(builtin_print__doc__,
{"print", _PyCFunction_CAST(builtin_print), METH_FASTCALL|METH_KEYWORDS, builtin_print__doc__},
static PyObject *
builtin_print_impl(PyObject *module, PyObject * const *args,
Py_ssize_t args_length, PyObject *sep, PyObject *end,
builtin_print_impl(PyObject *module, PyObject * const *objects,
Py_ssize_t objects_length, PyObject *sep, PyObject *end,
PyObject *file, int flush);
static PyObject *
@ -973,8 +973,8 @@ builtin_print(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec
PyObject *argsbuf[4];
PyObject * const *fastargs;
Py_ssize_t noptargs = 0 + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
PyObject * const *__clinic_args;
Py_ssize_t args_length;
PyObject * const *objects;
Py_ssize_t objects_length;
PyObject *sep = Py_None;
PyObject *end = Py_None;
PyObject *file = Py_None;
@ -1011,9 +1011,9 @@ builtin_print(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec
goto exit;
}
skip_optional_kwonly:
__clinic_args = args;
args_length = nargs;
return_value = builtin_print_impl(module, __clinic_args, args_length, sep, end, file, flush);
objects = args;
objects_length = nargs;
return_value = builtin_print_impl(module, objects, objects_length, sep, end, file, flush);
exit:
return return_value;
@ -1274,4 +1274,4 @@ builtin_issubclass(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
exit:
return return_value;
}
/*[clinic end generated code: output=cd5f80e3dc3082d5 input=a9049054013a1b77]*/
/*[clinic end generated code: output=c0b72519622c849e input=a9049054013a1b77]*/