mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
bpo-29464: Rename METH_FASTCALL to METH_FASTCALL|METH_KEYWORDS and make (#1955)
the bare METH_FASTCALL be used for functions with positional-only parameters.
This commit is contained in:
parent
aa0aa0492c
commit
6969eaf468
76 changed files with 616 additions and 1916 deletions
|
@ -9,7 +9,7 @@ PyDoc_STRVAR(warnings_warn__doc__,
|
|||
"Issue a warning, or maybe ignore it or raise an exception.");
|
||||
|
||||
#define WARNINGS_WARN_METHODDEF \
|
||||
{"warn", (PyCFunction)warnings_warn, METH_FASTCALL, warnings_warn__doc__},
|
||||
{"warn", (PyCFunction)warnings_warn, METH_FASTCALL|METH_KEYWORDS, warnings_warn__doc__},
|
||||
|
||||
static PyObject *
|
||||
warnings_warn_impl(PyObject *module, PyObject *message, PyObject *category,
|
||||
|
@ -35,4 +35,4 @@ warnings_warn(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwn
|
|||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=acadf1788059034c input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=74b1a7d1ee41816d input=a9049054013a1b77]*/
|
||||
|
|
|
@ -88,16 +88,12 @@ static PyObject *
|
|||
builtin_format_impl(PyObject *module, PyObject *value, PyObject *format_spec);
|
||||
|
||||
static PyObject *
|
||||
builtin_format(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
builtin_format(PyObject *module, PyObject **args, Py_ssize_t nargs)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *value;
|
||||
PyObject *format_spec = NULL;
|
||||
|
||||
if (!_PyArg_NoStackKeywords("format", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, "O|U:format",
|
||||
&value, &format_spec)) {
|
||||
goto exit;
|
||||
|
@ -154,7 +150,7 @@ PyDoc_STRVAR(builtin_compile__doc__,
|
|||
"in addition to any features explicitly specified.");
|
||||
|
||||
#define BUILTIN_COMPILE_METHODDEF \
|
||||
{"compile", (PyCFunction)builtin_compile, METH_FASTCALL, builtin_compile__doc__},
|
||||
{"compile", (PyCFunction)builtin_compile, METH_FASTCALL|METH_KEYWORDS, builtin_compile__doc__},
|
||||
|
||||
static PyObject *
|
||||
builtin_compile_impl(PyObject *module, PyObject *source, PyObject *filename,
|
||||
|
@ -197,16 +193,12 @@ static PyObject *
|
|||
builtin_divmod_impl(PyObject *module, PyObject *x, PyObject *y);
|
||||
|
||||
static PyObject *
|
||||
builtin_divmod(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
builtin_divmod(PyObject *module, PyObject **args, Py_ssize_t nargs)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *x;
|
||||
PyObject *y;
|
||||
|
||||
if (!_PyArg_NoStackKeywords("divmod", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_UnpackStack(args, nargs, "divmod",
|
||||
2, 2,
|
||||
&x, &y)) {
|
||||
|
@ -238,17 +230,13 @@ builtin_eval_impl(PyObject *module, PyObject *source, PyObject *globals,
|
|||
PyObject *locals);
|
||||
|
||||
static PyObject *
|
||||
builtin_eval(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
builtin_eval(PyObject *module, PyObject **args, Py_ssize_t nargs)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *source;
|
||||
PyObject *globals = Py_None;
|
||||
PyObject *locals = Py_None;
|
||||
|
||||
if (!_PyArg_NoStackKeywords("eval", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_UnpackStack(args, nargs, "eval",
|
||||
1, 3,
|
||||
&source, &globals, &locals)) {
|
||||
|
@ -280,17 +268,13 @@ builtin_exec_impl(PyObject *module, PyObject *source, PyObject *globals,
|
|||
PyObject *locals);
|
||||
|
||||
static PyObject *
|
||||
builtin_exec(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
builtin_exec(PyObject *module, PyObject **args, Py_ssize_t nargs)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *source;
|
||||
PyObject *globals = Py_None;
|
||||
PyObject *locals = Py_None;
|
||||
|
||||
if (!_PyArg_NoStackKeywords("exec", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_UnpackStack(args, nargs, "exec",
|
||||
1, 3,
|
||||
&source, &globals, &locals)) {
|
||||
|
@ -338,16 +322,12 @@ static PyObject *
|
|||
builtin_hasattr_impl(PyObject *module, PyObject *obj, PyObject *name);
|
||||
|
||||
static PyObject *
|
||||
builtin_hasattr(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
builtin_hasattr(PyObject *module, PyObject **args, Py_ssize_t nargs)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *obj;
|
||||
PyObject *name;
|
||||
|
||||
if (!_PyArg_NoStackKeywords("hasattr", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_UnpackStack(args, nargs, "hasattr",
|
||||
2, 2,
|
||||
&obj, &name)) {
|
||||
|
@ -387,17 +367,13 @@ builtin_setattr_impl(PyObject *module, PyObject *obj, PyObject *name,
|
|||
PyObject *value);
|
||||
|
||||
static PyObject *
|
||||
builtin_setattr(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
builtin_setattr(PyObject *module, PyObject **args, Py_ssize_t nargs)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *obj;
|
||||
PyObject *name;
|
||||
PyObject *value;
|
||||
|
||||
if (!_PyArg_NoStackKeywords("setattr", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_UnpackStack(args, nargs, "setattr",
|
||||
3, 3,
|
||||
&obj, &name, &value)) {
|
||||
|
@ -424,16 +400,12 @@ static PyObject *
|
|||
builtin_delattr_impl(PyObject *module, PyObject *obj, PyObject *name);
|
||||
|
||||
static PyObject *
|
||||
builtin_delattr(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
builtin_delattr(PyObject *module, PyObject **args, Py_ssize_t nargs)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *obj;
|
||||
PyObject *name;
|
||||
|
||||
if (!_PyArg_NoStackKeywords("delattr", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_UnpackStack(args, nargs, "delattr",
|
||||
2, 2,
|
||||
&obj, &name)) {
|
||||
|
@ -537,17 +509,13 @@ static PyObject *
|
|||
builtin_pow_impl(PyObject *module, PyObject *x, PyObject *y, PyObject *z);
|
||||
|
||||
static PyObject *
|
||||
builtin_pow(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
builtin_pow(PyObject *module, PyObject **args, Py_ssize_t nargs)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *x;
|
||||
PyObject *y;
|
||||
PyObject *z = Py_None;
|
||||
|
||||
if (!_PyArg_NoStackKeywords("pow", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_UnpackStack(args, nargs, "pow",
|
||||
2, 3,
|
||||
&x, &y, &z)) {
|
||||
|
@ -578,15 +546,11 @@ static PyObject *
|
|||
builtin_input_impl(PyObject *module, PyObject *prompt);
|
||||
|
||||
static PyObject *
|
||||
builtin_input(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
builtin_input(PyObject *module, PyObject **args, Py_ssize_t nargs)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *prompt = NULL;
|
||||
|
||||
if (!_PyArg_NoStackKeywords("input", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_UnpackStack(args, nargs, "input",
|
||||
0, 1,
|
||||
&prompt)) {
|
||||
|
@ -626,16 +590,12 @@ static PyObject *
|
|||
builtin_sum_impl(PyObject *module, PyObject *iterable, PyObject *start);
|
||||
|
||||
static PyObject *
|
||||
builtin_sum(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
builtin_sum(PyObject *module, PyObject **args, Py_ssize_t nargs)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *iterable;
|
||||
PyObject *start = NULL;
|
||||
|
||||
if (!_PyArg_NoStackKeywords("sum", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_UnpackStack(args, nargs, "sum",
|
||||
1, 2,
|
||||
&iterable, &start)) {
|
||||
|
@ -665,16 +625,12 @@ builtin_isinstance_impl(PyObject *module, PyObject *obj,
|
|||
PyObject *class_or_tuple);
|
||||
|
||||
static PyObject *
|
||||
builtin_isinstance(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
builtin_isinstance(PyObject *module, PyObject **args, Py_ssize_t nargs)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *obj;
|
||||
PyObject *class_or_tuple;
|
||||
|
||||
if (!_PyArg_NoStackKeywords("isinstance", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_UnpackStack(args, nargs, "isinstance",
|
||||
2, 2,
|
||||
&obj, &class_or_tuple)) {
|
||||
|
@ -704,16 +660,12 @@ builtin_issubclass_impl(PyObject *module, PyObject *cls,
|
|||
PyObject *class_or_tuple);
|
||||
|
||||
static PyObject *
|
||||
builtin_issubclass(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
builtin_issubclass(PyObject *module, PyObject **args, Py_ssize_t nargs)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *cls;
|
||||
PyObject *class_or_tuple;
|
||||
|
||||
if (!_PyArg_NoStackKeywords("issubclass", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_UnpackStack(args, nargs, "issubclass",
|
||||
2, 2,
|
||||
&cls, &class_or_tuple)) {
|
||||
|
@ -724,4 +676,4 @@ builtin_issubclass(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject
|
|||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=e1a7417a7b33eeec input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=09752daa8cdd6ec7 input=a9049054013a1b77]*/
|
||||
|
|
|
@ -82,16 +82,12 @@ _imp__fix_co_filename_impl(PyObject *module, PyCodeObject *code,
|
|||
PyObject *path);
|
||||
|
||||
static PyObject *
|
||||
_imp__fix_co_filename(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
_imp__fix_co_filename(PyObject *module, PyObject **args, Py_ssize_t nargs)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyCodeObject *code;
|
||||
PyObject *path;
|
||||
|
||||
if (!_PyArg_NoStackKeywords("_fix_co_filename", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, "O!U:_fix_co_filename",
|
||||
&PyCode_Type, &code, &path)) {
|
||||
goto exit;
|
||||
|
@ -279,16 +275,12 @@ static PyObject *
|
|||
_imp_create_dynamic_impl(PyObject *module, PyObject *spec, PyObject *file);
|
||||
|
||||
static PyObject *
|
||||
_imp_create_dynamic(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
_imp_create_dynamic(PyObject *module, PyObject **args, Py_ssize_t nargs)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *spec;
|
||||
PyObject *file = NULL;
|
||||
|
||||
if (!_PyArg_NoStackKeywords("create_dynamic", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_UnpackStack(args, nargs, "create_dynamic",
|
||||
1, 2,
|
||||
&spec, &file)) {
|
||||
|
@ -369,4 +361,4 @@ exit:
|
|||
#ifndef _IMP_EXEC_DYNAMIC_METHODDEF
|
||||
#define _IMP_EXEC_DYNAMIC_METHODDEF
|
||||
#endif /* !defined(_IMP_EXEC_DYNAMIC_METHODDEF) */
|
||||
/*[clinic end generated code: output=b970357dbbe25ee4 input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=d068dd493e513604 input=a9049054013a1b77]*/
|
||||
|
|
|
@ -27,17 +27,13 @@ marshal_dump_impl(PyObject *module, PyObject *value, PyObject *file,
|
|||
int version);
|
||||
|
||||
static PyObject *
|
||||
marshal_dump(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
marshal_dump(PyObject *module, PyObject **args, Py_ssize_t nargs)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *value;
|
||||
PyObject *file;
|
||||
int version = Py_MARSHAL_VERSION;
|
||||
|
||||
if (!_PyArg_NoStackKeywords("dump", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, "OO|i:dump",
|
||||
&value, &file, &version)) {
|
||||
goto exit;
|
||||
|
@ -88,16 +84,12 @@ static PyObject *
|
|||
marshal_dumps_impl(PyObject *module, PyObject *value, int version);
|
||||
|
||||
static PyObject *
|
||||
marshal_dumps(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
marshal_dumps(PyObject *module, PyObject **args, Py_ssize_t nargs)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *value;
|
||||
int version = Py_MARSHAL_VERSION;
|
||||
|
||||
if (!_PyArg_NoStackKeywords("dumps", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, "O|i:dumps",
|
||||
&value, &version)) {
|
||||
goto exit;
|
||||
|
@ -142,4 +134,4 @@ exit:
|
|||
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=7b147a648614af7e input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=15e284a34abfd26a input=a9049054013a1b77]*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue