mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Issue #24007: Argument Clinic now writes the format of PyArg_Parse*() at the
same line as function name.
This commit is contained in:
parent
a30e2256f7
commit
247789cee9
39 changed files with 377 additions and 823 deletions
|
@ -93,8 +93,7 @@ builtin_format(PyModuleDef *module, PyObject *args)
|
|||
PyObject *value;
|
||||
PyObject *format_spec = NULL;
|
||||
|
||||
if (!PyArg_ParseTuple(args,
|
||||
"O|U:format",
|
||||
if (!PyArg_ParseTuple(args, "O|U:format",
|
||||
&value, &format_spec))
|
||||
goto exit;
|
||||
return_value = builtin_format_impl(module, value, format_spec);
|
||||
|
@ -121,9 +120,7 @@ builtin_chr(PyModuleDef *module, PyObject *arg)
|
|||
PyObject *return_value = NULL;
|
||||
int i;
|
||||
|
||||
if (!PyArg_Parse(arg,
|
||||
"i:chr",
|
||||
&i))
|
||||
if (!PyArg_Parse(arg, "i:chr", &i))
|
||||
goto exit;
|
||||
return_value = builtin_chr_impl(module, i);
|
||||
|
||||
|
@ -169,8 +166,7 @@ builtin_compile(PyModuleDef *module, PyObject *args, PyObject *kwargs)
|
|||
int dont_inherit = 0;
|
||||
int optimize = -1;
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
|
||||
"OO&s|iii:compile", _keywords,
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO&s|iii:compile", _keywords,
|
||||
&source, PyUnicode_FSDecoder, &filename, &mode, &flags, &dont_inherit, &optimize))
|
||||
goto exit;
|
||||
return_value = builtin_compile_impl(module, source, filename, mode, flags, dont_inherit, optimize);
|
||||
|
@ -664,4 +660,4 @@ builtin_issubclass(PyModuleDef *module, PyObject *args)
|
|||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=b308ab64aa4d4ff8 input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=9b34d1ca57effad8 input=a9049054013a1b77]*/
|
||||
|
|
|
@ -88,8 +88,7 @@ _imp__fix_co_filename(PyModuleDef *module, PyObject *args)
|
|||
PyCodeObject *code;
|
||||
PyObject *path;
|
||||
|
||||
if (!PyArg_ParseTuple(args,
|
||||
"O!U:_fix_co_filename",
|
||||
if (!PyArg_ParseTuple(args, "O!U:_fix_co_filename",
|
||||
&PyCode_Type, &code, &path))
|
||||
goto exit;
|
||||
return_value = _imp__fix_co_filename_impl(module, code, path);
|
||||
|
@ -134,9 +133,7 @@ _imp_init_builtin(PyModuleDef *module, PyObject *arg)
|
|||
PyObject *return_value = NULL;
|
||||
PyObject *name;
|
||||
|
||||
if (!PyArg_Parse(arg,
|
||||
"U:init_builtin",
|
||||
&name))
|
||||
if (!PyArg_Parse(arg, "U:init_builtin", &name))
|
||||
goto exit;
|
||||
return_value = _imp_init_builtin_impl(module, name);
|
||||
|
||||
|
@ -162,9 +159,7 @@ _imp_init_frozen(PyModuleDef *module, PyObject *arg)
|
|||
PyObject *return_value = NULL;
|
||||
PyObject *name;
|
||||
|
||||
if (!PyArg_Parse(arg,
|
||||
"U:init_frozen",
|
||||
&name))
|
||||
if (!PyArg_Parse(arg, "U:init_frozen", &name))
|
||||
goto exit;
|
||||
return_value = _imp_init_frozen_impl(module, name);
|
||||
|
||||
|
@ -190,9 +185,7 @@ _imp_get_frozen_object(PyModuleDef *module, PyObject *arg)
|
|||
PyObject *return_value = NULL;
|
||||
PyObject *name;
|
||||
|
||||
if (!PyArg_Parse(arg,
|
||||
"U:get_frozen_object",
|
||||
&name))
|
||||
if (!PyArg_Parse(arg, "U:get_frozen_object", &name))
|
||||
goto exit;
|
||||
return_value = _imp_get_frozen_object_impl(module, name);
|
||||
|
||||
|
@ -218,9 +211,7 @@ _imp_is_frozen_package(PyModuleDef *module, PyObject *arg)
|
|||
PyObject *return_value = NULL;
|
||||
PyObject *name;
|
||||
|
||||
if (!PyArg_Parse(arg,
|
||||
"U:is_frozen_package",
|
||||
&name))
|
||||
if (!PyArg_Parse(arg, "U:is_frozen_package", &name))
|
||||
goto exit;
|
||||
return_value = _imp_is_frozen_package_impl(module, name);
|
||||
|
||||
|
@ -246,9 +237,7 @@ _imp_is_builtin(PyModuleDef *module, PyObject *arg)
|
|||
PyObject *return_value = NULL;
|
||||
PyObject *name;
|
||||
|
||||
if (!PyArg_Parse(arg,
|
||||
"U:is_builtin",
|
||||
&name))
|
||||
if (!PyArg_Parse(arg, "U:is_builtin", &name))
|
||||
goto exit;
|
||||
return_value = _imp_is_builtin_impl(module, name);
|
||||
|
||||
|
@ -274,9 +263,7 @@ _imp_is_frozen(PyModuleDef *module, PyObject *arg)
|
|||
PyObject *return_value = NULL;
|
||||
PyObject *name;
|
||||
|
||||
if (!PyArg_Parse(arg,
|
||||
"U:is_frozen",
|
||||
&name))
|
||||
if (!PyArg_Parse(arg, "U:is_frozen", &name))
|
||||
goto exit;
|
||||
return_value = _imp_is_frozen_impl(module, name);
|
||||
|
||||
|
@ -307,8 +294,7 @@ _imp_load_dynamic(PyModuleDef *module, PyObject *args)
|
|||
PyObject *path;
|
||||
PyObject *file = NULL;
|
||||
|
||||
if (!PyArg_ParseTuple(args,
|
||||
"UO&|O:load_dynamic",
|
||||
if (!PyArg_ParseTuple(args, "UO&|O:load_dynamic",
|
||||
&name, PyUnicode_FSDecoder, &path, &file))
|
||||
goto exit;
|
||||
return_value = _imp_load_dynamic_impl(module, name, path, file);
|
||||
|
@ -322,4 +308,4 @@ exit:
|
|||
#ifndef _IMP_LOAD_DYNAMIC_METHODDEF
|
||||
#define _IMP_LOAD_DYNAMIC_METHODDEF
|
||||
#endif /* !defined(_IMP_LOAD_DYNAMIC_METHODDEF) */
|
||||
/*[clinic end generated code: output=b64fe33fe76591cf input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=6d75cece35863874 input=a9049054013a1b77]*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue