From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Sun, 21 Jan 2024 13:03:53 +0000 (+0100) Subject: [3.11] gh-114384: Align sys.set_asyncgen_hooks signature in docs to reflect implement... X-Git-Tag: v3.11.8~113 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d2cfb5b258f8355f47fe461479cceb3a476176c6;p=thirdparty%2FPython%2Fcpython.git [3.11] gh-114384: Align sys.set_asyncgen_hooks signature in docs to reflect implementation (GH-114385) (#114387) (cherry picked from commit 38768e4cdd1c4b6e03702da8a94e1c22479d6ed3) Co-authored-by: Nikita Sobolev --- diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst index 6fbfbde4c770..2a1e6fb1a9cf 100644 --- a/Doc/library/sys.rst +++ b/Doc/library/sys.rst @@ -1606,7 +1606,7 @@ always available. ``'opcode'`` event type added; :attr:`~frame.f_trace_lines` and :attr:`~frame.f_trace_opcodes` attributes added to frames -.. function:: set_asyncgen_hooks(firstiter, finalizer) +.. function:: set_asyncgen_hooks([firstiter] [, finalizer]) Accepts two optional keyword arguments which are callables that accept an :term:`asynchronous generator iterator` as an argument. The *firstiter* diff --git a/Python/sysmodule.c b/Python/sysmodule.c index d0941e8cfebe..89f454cdc53f 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -1282,7 +1282,7 @@ sys_set_asyncgen_hooks(PyObject *self, PyObject *args, PyObject *kw) } PyDoc_STRVAR(set_asyncgen_hooks_doc, -"set_asyncgen_hooks(* [, firstiter] [, finalizer])\n\ +"set_asyncgen_hooks([firstiter] [, finalizer])\n\ \n\ Set a finalizer for async generators objects." );