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.
diff --git a/Objects/clinic/enumobject.c.h b/Objects/clinic/enumobject.c.h
index 0f05cf8..27da294 100644
--- a/Objects/clinic/enumobject.c.h
+++ b/Objects/clinic/enumobject.c.h
@@ -58,14 +58,13 @@
!_PyArg_NoKeywords("reversed", kwargs)) {
goto exit;
}
- if (!PyArg_UnpackTuple(args, "reversed",
- 1, 1,
- &seq)) {
+ if (!_PyArg_CheckPositional("reversed", PyTuple_GET_SIZE(args), 1, 1)) {
goto exit;
}
+ seq = PyTuple_GET_ITEM(args, 0);
return_value = reversed_new_impl(type, seq);
exit:
return return_value;
}
-/*[clinic end generated code: output=9008c36999c57218 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=831cec3db0e987c9 input=a9049054013a1b77]*/