summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorDave Goncalves <davegoncalves@gmail.com>2022-03-31 13:56:48 (GMT)
committerGitHub <noreply@github.com>2022-03-31 13:56:48 (GMT)
commit8be7c2bc5ad5e295f0f855bb31db412eef2c7c92 (patch)
tree959b21391f252bd6a4ac2935b4035007ed52bdb4 /Objects
parenta00518d9ad9a8f408a9699191019d75dd8406c32 (diff)
downloadcpython-8be7c2bc5ad5e295f0f855bb31db412eef2c7c92.zip
cpython-8be7c2bc5ad5e295f0f855bb31db412eef2c7c92.tar.gz
cpython-8be7c2bc5ad5e295f0f855bb31db412eef2c7c92.tar.bz2
bpo-14911: Corrected generator.throw() documentation (GH-32207)
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
Diffstat (limited to 'Objects')
-rw-r--r--Objects/genobject.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/Objects/genobject.c b/Objects/genobject.c
index f071390..cdb2a0f 100644
--- a/Objects/genobject.c
+++ b/Objects/genobject.c
@@ -410,8 +410,11 @@ gen_close(PyGenObject *gen, PyObject *args)
PyDoc_STRVAR(throw_doc,
-"throw(typ[,val[,tb]]) -> raise exception in generator,\n\
-return next yielded value or raise StopIteration.");
+"throw(value)\n\
+throw(type[,value[,tb]])\n\
+\n\
+Raise exception in generator, return next yielded value or raise\n\
+StopIteration.");
static PyObject *
_gen_throw(PyGenObject *gen, int close_on_genexit,
@@ -1157,8 +1160,11 @@ PyDoc_STRVAR(coro_send_doc,
return next iterated value or raise StopIteration.");
PyDoc_STRVAR(coro_throw_doc,
-"throw(typ[,val[,tb]]) -> raise exception in coroutine,\n\
-return next iterated value or raise StopIteration.");
+"throw(value)\n\
+throw(type[,value[,traceback]])\n\
+\n\
+Raise exception in coroutine, return next iterated value or raise\n\
+StopIteration.");
PyDoc_STRVAR(coro_close_doc,
"close() -> raise GeneratorExit inside coroutine.");