]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
call_method():
authorGuido van Rossum <guido@python.org>
Fri, 14 Sep 2001 16:58:08 +0000 (16:58 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 14 Sep 2001 16:58:08 +0000 (16:58 +0000)
commit717ce00c7cd3198118d2de5ae23601828ae1061a
treec6b10f0b9f3db854dc38143010bf09b3d7471dbc
parent5560b7492c8dbe17a29362a66102662e5e22a9d2
call_method():

- Don't turn a non-tuple argument into a one-tuple.  Rather, the
  caller must pass a format that causes Py_VaBuildValue() to return a
  tuple.

- Speed things up by calling PyObject_Call (which is fairly low-level
  and straightforward) rather than PyObject_CallObject (which calls
  PyEval_CallObjectWithKeywords which calls PyObject_Call, and nothing
  is really done in the mean time except some tests for NULL args and
  valid types, which are already guaranteed).

- Cosmetics.

Other places:

- Make sure that the format argument to call_method() is surrounded by
  parentheses, so it will cause a tuple to be created.

- Replace a few calls to PyEval_CallObject() with a surefire tuple for
  args to calls to PyObject_Call().  (A few calls to
  PyEval_CallObject() remain that have NULL for args.)
Objects/typeobject.c