diff Objects/funcobject.c @ 26818:e094a03a80ff legacy-trunk

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.
author Raymond Hettinger <python@rcn.com>
date Sun, 29 Dec 2002 16:33:45 +0000
parents 6eb74e83a6f1
children faabd9867fb8
line wrap: on
line diff
--- a/Objects/funcobject.c	Sun Dec 29 05:49:09 2002 +0000
+++ b/Objects/funcobject.c	Sun Dec 29 16:33:45 2002 +0000
@@ -588,7 +588,7 @@
 	classmethod *cm = (classmethod *)self;
 	PyObject *callable;
 
-	if (!PyArg_ParseTuple(args, "O:classmethod", &callable))
+	if (!PyArg_UnpackTuple(args, "classmethod", 1, 1, &callable))
 		return -1;
 	Py_INCREF(callable);
 	cm->cm_callable = callable;
@@ -720,7 +720,7 @@
 	staticmethod *sm = (staticmethod *)self;
 	PyObject *callable;
 
-	if (!PyArg_ParseTuple(args, "O:staticmethod", &callable))
+	if (!PyArg_UnpackTuple(args, "staticmethod", 1, 1, &callable))
 		return -1;
 	Py_INCREF(callable);
 	sm->sm_callable = callable;