diff options
author | Victor Stinner <vstinner@redhat.com> | 2019-06-17 17:15:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-17 17:15:36 +0200 |
commit | 5352cc41fa4eb5f0dc847709392e88473b8593b0 (patch) | |
tree | 52e61a0ba8c225290589b6907606004e67db54cc | |
parent | 1b8a46d59734a77cd1f5ffcf3bdfcaafd58a87e7 (diff) | |
download | cpython-git-5352cc41fa4eb5f0dc847709392e88473b8593b0.tar.gz |
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.
-rw-r--r-- | Doc/c-api/object.rst | 3 | ||||
-rw-r--r-- | Doc/whatsnew/3.9.rst | 5 |
2 files changed, 6 insertions, 2 deletions
diff --git a/Doc/c-api/object.rst b/Doc/c-api/object.rst index e4787ad39c..13f13b3489 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 c5cb626a1b..3da8b1685b 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 |