mirror of
https://github.com/python/cpython.git
synced 2025-10-10 00:43:41 +00:00
bpo-14911: Corrected generator.throw() documentation (GH-32207)
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
This commit is contained in:
parent
a00518d9ad
commit
8be7c2bc5a
4 changed files with 28 additions and 8 deletions
|
@ -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.");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue