From: Nikita Sobolev Date: Sun, 21 Jan 2024 12:49:49 +0000 (+0300) Subject: gh-114384: Align sys.set_asyncgen_hooks signature in docs to reflect implementation... X-Git-Tag: v3.13.0a4~397 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=38768e4cdd1c4b6e03702da8a94e1c22479d6ed3;p=thirdparty%2FPython%2Fcpython.git gh-114384: Align sys.set_asyncgen_hooks signature in docs to reflect implementation (#114385) --- diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst index c37166393431..abf2c393a449 100644 --- a/Doc/library/sys.rst +++ b/Doc/library/sys.rst @@ -1655,7 +1655,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 c2de4ecdc8ce..f558a00a6916 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -1420,7 +1420,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." );