comparison Python/bltinmodule.c @ 45045:e791bb0adcde legacy-trunk

CallMethod is faster with a NULL third-argument than with an empty format string.
author Raymond Hettinger <python@rcn.com>
date Tue, 29 Jan 2008 19:52:09 +0000
parents 4c8308ac20cd
children 492b302aded6
comparison
equal deleted inserted replaced
45043:cc22d3f12b13 45045:e791bb0adcde
2048 builtin_trunc(PyObject *self, PyObject *number) 2048 builtin_trunc(PyObject *self, PyObject *number)
2049 { 2049 {
2050 /* XXX: The py3k branch gets better errors for this by using 2050 /* XXX: The py3k branch gets better errors for this by using
2051 _PyType_Lookup(), but since float's mro isn't set in py2.6, 2051 _PyType_Lookup(), but since float's mro isn't set in py2.6,
2052 we just use PyObject_CallMethod here. */ 2052 we just use PyObject_CallMethod here. */
2053 return PyObject_CallMethod(number, "__trunc__", ""); 2053 return PyObject_CallMethod(number, "__trunc__", NULL);
2054 } 2054 }
2055 2055
2056 PyDoc_STRVAR(trunc_doc, 2056 PyDoc_STRVAR(trunc_doc,
2057 "trunc(Real) -> Integral\n\ 2057 "trunc(Real) -> Integral\n\
2058 \n\ 2058 \n\