summaryrefslogtreecommitdiffstats
path: root/Python/bltinmodule.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2017-07-03 18:20:15 (GMT)
committerGitHub <noreply@github.com>2017-07-03 18:20:15 (GMT)
commit6969eaf4682beb01bc95eeb14f5ce6c01312e297 (patch)
treec81a3d9bca3e9d01f557c46a8534a4e3873403f9 /Python/bltinmodule.c
parentaa0aa0492c5fffe750a26d2ab13737a1a6d7d63c (diff)
downloadcpython-6969eaf4682beb01bc95eeb14f5ce6c01312e297.zip
cpython-6969eaf4682beb01bc95eeb14f5ce6c01312e297.tar.gz
cpython-6969eaf4682beb01bc95eeb14f5ce6c01312e297.tar.bz2
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.
Diffstat (limited to 'Python/bltinmodule.c')
-rw-r--r--Python/bltinmodule.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index d16b1b4..85f207b 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -991,16 +991,11 @@ builtin_exec_impl(PyObject *module, PyObject *source, PyObject *globals,
/* AC: cannot convert yet, as needs PEP 457 group support in inspect */
static PyObject *
-builtin_getattr(PyObject *self, PyObject **args, Py_ssize_t nargs,
- PyObject *kwnames)
+builtin_getattr(PyObject *self, PyObject **args, Py_ssize_t nargs)
{
PyObject *v, *result, *dflt = NULL;
PyObject *name;
- if (!_PyArg_NoStackKeywords("getattr", kwnames)) {
- return NULL;
- }
-
if (!_PyArg_UnpackStack(args, nargs, "getattr", 2, 3, &v, &name, &dflt))
return NULL;
@@ -1301,16 +1296,11 @@ PyTypeObject PyMap_Type = {
/* AC: cannot convert yet, as needs PEP 457 group support in inspect */
static PyObject *
-builtin_next(PyObject *self, PyObject **args, Py_ssize_t nargs,
- PyObject *kwnames)
+builtin_next(PyObject *self, PyObject **args, Py_ssize_t nargs)
{
PyObject *it, *res;
PyObject *def = NULL;
- if (!_PyArg_NoStackKeywords("next", kwnames)) {
- return NULL;
- }
-
if (!_PyArg_UnpackStack(args, nargs, "next", 1, 2, &it, &def))
return NULL;
@@ -2130,7 +2120,7 @@ PyDoc_STRVAR(builtin_sorted__doc__,
"reverse flag can be set to request the result in descending order.");
#define BUILTIN_SORTED_METHODDEF \
- {"sorted", (PyCFunction)builtin_sorted, METH_FASTCALL, builtin_sorted__doc__},
+ {"sorted", (PyCFunction)builtin_sorted, METH_FASTCALL | METH_KEYWORDS, builtin_sorted__doc__},
static PyObject *
builtin_sorted(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
@@ -2622,7 +2612,7 @@ PyTypeObject PyZip_Type = {
static PyMethodDef builtin_methods[] = {
{"__build_class__", (PyCFunction)builtin___build_class__,
- METH_FASTCALL, build_class_doc},
+ METH_FASTCALL | METH_KEYWORDS, build_class_doc},
{"__import__", (PyCFunction)builtin___import__, METH_VARARGS | METH_KEYWORDS, import_doc},
BUILTIN_ABS_METHODDEF
BUILTIN_ALL_METHODDEF
@@ -2656,7 +2646,7 @@ static PyMethodDef builtin_methods[] = {
BUILTIN_OCT_METHODDEF
BUILTIN_ORD_METHODDEF
BUILTIN_POW_METHODDEF
- {"print", (PyCFunction)builtin_print, METH_FASTCALL, print_doc},
+ {"print", (PyCFunction)builtin_print, METH_FASTCALL | METH_KEYWORDS, print_doc},
BUILTIN_REPR_METHODDEF
{"round", (PyCFunction)builtin_round, METH_VARARGS | METH_KEYWORDS, round_doc},
BUILTIN_SETATTR_METHODDEF