[Python-checkins] bpo-37194: Add PyObject_CallNoArgs() rationale (GH-14159)

Victor Stinner webhook-mailer at python.org
Mon Jun 17 11:16:00 EDT 2019


https://github.com/python/cpython/commit/5352cc41fa4eb5f0dc847709392e88473b8593b0
commit: 5352cc41fa4eb5f0dc847709392e88473b8593b0
branch: master
author: Victor Stinner <vstinner at redhat.com>
committer: GitHub <noreply at github.com>
date: 2019-06-17T17:15:36+02:00
summary:

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.

files:
M Doc/c-api/object.rst
M Doc/whatsnew/3.9.rst

diff --git a/Doc/c-api/object.rst b/Doc/c-api/object.rst
index e4787ad39c08..13f13b3489b8 100644
--- a/Doc/c-api/object.rst
+++ b/Doc/c-api/object.rst
@@ -255,7 +255,8 @@ Object Protocol
 
 .. 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
    *NULL* on failure.
diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst
index c5cb626a1b6b..3da8b1685bde 100644
--- a/Doc/whatsnew/3.9.rst
+++ b/Doc/whatsnew/3.9.rst
@@ -103,7 +103,10 @@ Build and C API Changes
 =======================
 
 * 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



More information about the Python-checkins mailing list