Kaydet (Commit) 4c38154a authored tarafından Victor Stinner's avatar Victor Stinner

Don't parenthesis in _PyObject_CallMethodId() format

Issue #28915: Without parenthesis, _PyObject_CallMethodId() avoids the creation
a temporary tuple, and so is more efficient.
üst ef7def94
......@@ -4673,7 +4673,7 @@ datetime_repr(PyDateTime_DateTime *self)
static PyObject *
datetime_str(PyDateTime_DateTime *self)
{
return _PyObject_CallMethodId((PyObject *)self, &PyId_isoformat, "(s)", " ");
return _PyObject_CallMethodId((PyObject *)self, &PyId_isoformat, "s", " ");
}
static PyObject *
......
......@@ -5716,7 +5716,7 @@ PyInit__decimal(void)
/* DecimalTuple */
ASSIGN_PTR(collections, PyImport_ImportModule("collections"));
ASSIGN_PTR(DecimalTuple, (PyTypeObject *)PyObject_CallMethod(collections,
"namedtuple", "(ss)", "DecimalTuple",
"namedtuple", "ss", "DecimalTuple",
"sign digits exponent"));
ASSIGN_PTR(obj, PyUnicode_FromString("decimal"));
......
......@@ -335,7 +335,7 @@ raise_errmsg(const char *msg, PyObject *s, Py_ssize_t end)
if (JSONDecodeError == NULL)
return;
}
exc = PyObject_CallFunction(JSONDecodeError, "(zOn)", msg, s, end);
exc = PyObject_CallFunction(JSONDecodeError, "zOn", msg, s, end);
if (exc) {
PyErr_SetObject(JSONDecodeError, exc);
Py_DECREF(exc);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment