mirror of
https://github.com/python/cpython.git
synced 2025-08-02 16:13:13 +00:00
bpo-37194: Add PyObject_CallNoArgs() rationale (GH-14159)
Explain in the doc why PyObject_CallNoArgs() should be preferred over other existing ways to call a function without any arguments.
This commit is contained in:
parent
1b8a46d597
commit
5352cc41fa
2 changed files with 6 additions and 2 deletions
|
@ -255,7 +255,8 @@ Object Protocol
|
||||||
|
|
||||||
.. c:function:: PyObject* PyObject_CallNoArgs(PyObject *callable)
|
.. c:function:: PyObject* PyObject_CallNoArgs(PyObject *callable)
|
||||||
|
|
||||||
Call a callable Python object *callable* without any arguments.
|
Call a callable Python object *callable* without any arguments. It is the
|
||||||
|
most efficient way to call a callable Python object without any argument.
|
||||||
|
|
||||||
Return the result of the call on success, or raise an exception and return
|
Return the result of the call on success, or raise an exception and return
|
||||||
*NULL* on failure.
|
*NULL* on failure.
|
||||||
|
|
|
@ -103,7 +103,10 @@ Build and C API Changes
|
||||||
=======================
|
=======================
|
||||||
|
|
||||||
* Add a new public :c:func:`PyObject_CallNoArgs` function to the C API:
|
* Add a new public :c:func:`PyObject_CallNoArgs` function to the C API:
|
||||||
call a callable Python object without any arguments.
|
call a callable Python object without any arguments. It is the most efficient
|
||||||
|
way to call a callable Python object without any argument.
|
||||||
|
(Contributed by Victor Stinner in :issue:`37194`.)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Deprecated
|
Deprecated
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue