]> granicus.if.org Git - python/commitdiff
bpo-37194: Add PyObject_CallNoArgs() rationale (GH-14159)
authorVictor Stinner <vstinner@redhat.com>
Mon, 17 Jun 2019 15:15:36 +0000 (17:15 +0200)
committerGitHub <noreply@github.com>
Mon, 17 Jun 2019 15:15:36 +0000 (17:15 +0200)
Explain in the doc why PyObject_CallNoArgs() should be preferred over
other existing ways to call a function without any arguments.

Doc/c-api/object.rst
Doc/whatsnew/3.9.rst

index e4787ad39c080a37708dced9f6c22ac569aa5ad2..13f13b3489b81fadc9cd0506b271baaefd7fbccb 100644 (file)
@@ -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.
index c5cb626a1b6b14976e1a008c691b2c57cabba974..3da8b1685bde60ee1946b423e177bf1edd17294d 100644 (file)
@@ -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