8000 bpo-39245: Make Vectorcall public by encukou · Pull Request #17893 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-39245: Make Vectorcall public #17893

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Feb 6, 2020
Prev Previous commit
Next Next commit
Put PyObject_CallNoArgs back in the limited API
  • Loading branch information
encukou committed Jan 8, 2020
commit 60a8833584767d2651579deddaf594401f2d18fa
2 changes: 0 additions & 2 deletions Doc/c-api/call.rst
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,6 @@ please see individual documentation for details.
Return the result of the call on success, or raise an exception and return
*NULL* on failure.

This function is not part of the `limited API <stable>`_.

.. versionadded:: 3.9


Expand Down
6 changes: 6 additions & 0 deletions Include/abstract.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,12 @@ extern "C" {
#endif


#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03090000
/* Call a callable Python object without any arguments */
PyAPI_FUNC(PyObject *) PyObject_CallNoArgs(PyObject *func);
#endif


/* Call a callable Python object 'callable' with arguments given by the
tuple 'args' and keywords arguments given by the dictionary 'kwargs'.

Expand Down
4 changes: 1 addition & 3 deletions Include/cpython/abstract.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ PyObject_Vectorcall(PyObject *callable, PyObject *const *args,
return _PyObject_VectorcallTstate(tstate, callable,
args, nargsf, kwnames);
}

// Backwards compatibility aliases for API that was provisional in Python 3.8
#define _PyObject_Vectorcall PyObject_Vectorcall
#define _PyObject_VectorcallMethod PyObject_VectorcallMethod
Expand Down Expand Up @@ -190,9 +191,6 @@ PyObject_CallMethodOneArg(PyObject *self, PyObject *name, PyObject *arg)
2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
}

/* Call a callable Python object without any arguments */
PyAPI_FUNC(PyObject *) PyObject_CallNoArgs(PyObject *func);

/* Like PyObject_CallMethod(), but expect a _Py_Identifier*
as the method name. */
PyAPI_FUNC(PyObject *) _PyObject_CallMethodId(PyObject *obj,
Expand Down
0