CallMethod is faster with a NULL third-argument than with an empty format string.

This commit is contained in:
Raymond Hettinger 2008-01-29 19:52:09 +00:00
parent 9748a1098f
commit 867558afd6

View file

@ -2050,7 +2050,7 @@ builtin_trunc(PyObject *self, PyObject *number)
/* XXX: The py3k branch gets better errors for this by using
_PyType_Lookup(), but since float's mro isn't set in py2.6,
we just use PyObject_CallMethod here. */
return PyObject_CallMethod(number, "__trunc__", "");
return PyObject_CallMethod(number, "__trunc__", NULL);
}
PyDoc_STRVAR(trunc_doc,