summaryrefslogtreecommitdiffstats
path: root/Modules/clinic/_abc.c.h
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2019-01-11 16:01:42 (GMT)
committerGitHub <noreply@github.com>2019-01-11 16:01:42 (GMT)
commit2a39d251f07d4c620e3b9a1848e3d1eb3067be64 (patch)
tree23c1e8e63e57945fab6127d31800b7578795e14b /Modules/clinic/_abc.c.h
parent4fa9591025b6a098f3d6402e5413ee6740ede6c5 (diff)
downloadcpython-2a39d251f07d4c620e3b9a1848e3d1eb3067be64.zip
cpython-2a39d251f07d4c620e3b9a1848e3d1eb3067be64.tar.gz
cpython-2a39d251f07d4c620e3b9a1848e3d1eb3067be64.tar.bz2
bpo-35582: Argument Clinic: Optimize the "all boring objects" case. (GH-11520)
Use _PyArg_CheckPositional() and inlined code instead of PyArg_UnpackTuple() and _PyArg_UnpackStack() if all parameters are positional and use the "object" converter.
Diffstat (limited to 'Modules/clinic/_abc.c.h')
-rw-r--r--Modules/clinic/_abc.c.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/Modules/clinic/_abc.c.h b/Modules/clinic/_abc.c.h
index 22ddb6c..62c6552 100644
--- a/Modules/clinic/_abc.c.h
+++ b/Modules/clinic/_abc.c.h
@@ -65,11 +65,11 @@ _abc__abc_register(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
PyObject *self;
PyObject *subclass;
- if (!_PyArg_UnpackStack(args, nargs, "_abc_register",
- 2, 2,
- &self, &subclass)) {
+ if (!_PyArg_CheckPositional("_abc_register", nargs, 2, 2)) {
goto exit;
}
+ self = args[0];
+ subclass = args[1];
return_value = _abc__abc_register_impl(module, self, subclass);
exit:
@@ -96,11 +96,11 @@ _abc__abc_instancecheck(PyObject *module, PyObject *const *args, Py_ssize_t narg
PyObject *self;
PyObject *instance;
- if (!_PyArg_UnpackStack(args, nargs, "_abc_instancecheck",
- 2, 2,
- &self, &instance)) {
+ if (!_PyArg_CheckPositional("_abc_instancecheck", nargs, 2, 2)) {
goto exit;
}
+ self = args[0];
+ instance = args[1];
return_value = _abc__abc_instancecheck_impl(module, self, instance);
exit:
@@ -127,11 +127,11 @@ _abc__abc_subclasscheck(PyObject *module, PyObject *const *args, Py_ssize_t narg
PyObject *self;
PyObject *subclass;
- if (!_PyArg_UnpackStack(args, nargs, "_abc_subclasscheck",
- 2, 2,
- &self, &subclass)) {
+ if (!_PyArg_CheckPositional("_abc_subclasscheck", nargs, 2, 2)) {
goto exit;
}
+ self = args[0];
+ subclass = args[1];
return_value = _abc__abc_subclasscheck_impl(module, self, subclass);
exit:
@@ -159,4 +159,4 @@ _abc_get_cache_token(PyObject *module, PyObject *Py_UNUSED(ignored))
{
return _abc_get_cache_token_impl(module);
}
-/*[clinic end generated code: output=606db3cb658d9240 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=2544b4b5ae50a089 input=a9049054013a1b77]*/