diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2022-03-31 14:23:04 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-31 14:23:04 (GMT) |
commit | 625f6704c0d783360574bbab2f78b0b9bbed5891 (patch) | |
tree | a2ab62275367ae44976fa58c20c4fca3c9948056 /Objects | |
parent | 1f2ec4cef1804cda9d2df99a318373b2982919e9 (diff) | |
download | cpython-625f6704c0d783360574bbab2f78b0b9bbed5891.zip cpython-625f6704c0d783360574bbab2f78b0b9bbed5891.tar.gz cpython-625f6704c0d783360574bbab2f78b0b9bbed5891.tar.bz2 |
bpo-14911: Corrected generator.throw() documentation (GH-32207)
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
(cherry picked from commit 8be7c2bc5ad5e295f0f855bb31db412eef2c7c92)
Co-authored-by: Dave Goncalves <davegoncalves@gmail.com>
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/genobject.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/Objects/genobject.c b/Objects/genobject.c index 33fc4a5..123c17a 100644 --- a/Objects/genobject.c +++ b/Objects/genobject.c @@ -403,8 +403,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, @@ -1001,8 +1004,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."); |