SF patch #659536: Use PyArg_UnpackTuple where possible.
Obtain cleaner coding and a system wide
performance boost by using the fast, pre-parsed
PyArg_Unpack function instead of PyArg_ParseTuple
function which is driven by a format string.
diff --git a/Objects/descrobject.c b/Objects/descrobject.c
index 761e1ab..6c78778 100644
--- a/Objects/descrobject.c
+++ b/Objects/descrobject.c
@@ -686,7 +686,7 @@
{
PyObject *key, *def = Py_None;
- if (!PyArg_ParseTuple(args, "O|O:get", &key, &def))
+ if (!PyArg_UnpackTuple(args, "get", 1, 2, &key, &def))
return NULL;
return PyObject_CallMethod(pp->dict, "get", "(OO)", key, def);
}