summaryrefslogtreecommitdiffstats
path: root/Doc/reference
diff options
context:
space:
mode:
authorOfey Chan <ofey206@gmail.com>2022-09-30 08:43:02 (GMT)
committerGitHub <noreply@github.com>2022-09-30 08:43:02 (GMT)
commit83a3de4e0632d90e0d1d5a9b8859a94c9ac25f65 (patch)
tree31d942b63699bc5e1848ffb6f85901fe8b93301c /Doc/reference
parent9a11ed8e50492d327e4de0a8f3a473e788b14a6f (diff)
downloadcpython-83a3de4e0632d90e0d1d5a9b8859a94c9ac25f65.zip
cpython-83a3de4e0632d90e0d1d5a9b8859a94c9ac25f65.tar.gz
cpython-83a3de4e0632d90e0d1d5a9b8859a94c9ac25f65.tar.bz2
gh-96348: Deprecate the 3-arg signature of coroutine.throw and generator.throw (GH-96428)
Diffstat (limited to 'Doc/reference')
-rw-r--r--Doc/reference/datamodel.rst5
-rw-r--r--Doc/reference/expressions.rst13
2 files changed, 17 insertions, 1 deletions
diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst
index 758f3ae..c93269a 100644
--- a/Doc/reference/datamodel.rst
+++ b/Doc/reference/datamodel.rst
@@ -2996,6 +2996,11 @@ generators, coroutines do not directly support iteration.
above. If the exception is not caught in the coroutine, it propagates
back to the caller.
+ .. versionchanged:: 3.12
+
+ The second signature \(type\[, value\[, traceback\]\]\) is deprecated and
+ may be removed in a future version of Python.
+
.. method:: coroutine.close()
Causes the coroutine to clean itself up and exit. If the coroutine
diff --git a/Doc/reference/expressions.rst b/Doc/reference/expressions.rst
index 6d23e47..a6ca55d 100644
--- a/Doc/reference/expressions.rst
+++ b/Doc/reference/expressions.rst
@@ -582,6 +582,11 @@ is already executing raises a :exc:`ValueError` exception.
:attr:`~BaseException.__traceback__` attribute stored in *value* may
be cleared.
+ .. versionchanged:: 3.12
+
+ The second signature \(type\[, value\[, traceback\]\]\) is deprecated and
+ may be removed in a future version of Python.
+
.. index:: exception: GeneratorExit
@@ -738,7 +743,8 @@ which are used to control the execution of a generator function.
because there is no yield expression that could receive the value.
-.. coroutinemethod:: agen.athrow(type[, value[, traceback]])
+.. coroutinemethod:: agen.athrow(value)
+ agen.athrow(type[, value[, traceback]])
Returns an awaitable that raises an exception of type ``type`` at the point
where the asynchronous generator was paused, and returns the next value
@@ -750,6 +756,11 @@ which are used to control the execution of a generator function.
raises a different exception, then when the awaitable is run that exception
propagates to the caller of the awaitable.
+ .. versionchanged:: 3.12
+
+ The second signature \(type\[, value\[, traceback\]\]\) is deprecated and
+ may be removed in a future version of Python.
+
.. index:: exception: GeneratorExit