[Python-checkins] [python/cpython] aa289a: bpo-29548: Recommend PyObject_Call APIs over PyEva...

GitHub noreply at github.com
Tue Mar 14 05:01:00 EDT 2017


  Branch: refs/heads/master
  Home:   https://github.com/python/cpython
  Commit: aa289a59ff6398110e1122877c073c9354ee53db
      https://github.com/python/cpython/commit/aa289a59ff6398110e1122877c073c9354ee53db
  Author: INADA Naoki <methane at users.noreply.github.com>
  Date:   2017-03-14 (Tue, 14 Mar 2017)

  Changed paths:
    M Include/ceval.h
    M Objects/call.c

  Log Message:
  -----------
  bpo-29548: Recommend PyObject_Call APIs over PyEval_Call APIs. (GH-75)

PyEval_Call* APIs are not documented and they doesn't respect PY_SSIZE_T_CLEAN.
So add comment block which recommends PyObject_Call* APIs to ceval.h.

This commit also changes PyEval_CallMethod and PyEval_CallFunction
implementation same to PyObject_CallMethod and PyObject_CallFunction
to reduce future maintenance cost.  Optimization to avoid temporary
tuple are copied too.

PyEval_CallFunction(callable, "i", (int)i) now calls callable(i) instead of
raising TypeError.  But accepting this edge case is backward compatible.




More information about the Python-checkins mailing list