Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

gh-96348: Deprecate the 3-arg signature of coroutine.throw, generator.throw and agen.athrow #96428

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 30 commits into from
Sep 30, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
b388f9a
feat: Deprecate gen.throw(typ, val, tb)
ofey404 Aug 30, 2022
713d77a
Update Objects/genobject.c
ofey404 Aug 31, 2022
fcfb65e
fix clear cases
ofey404 Sep 1, 2022
073aa62
Update Misc/NEWS.d/next/Core and Builtins/2022-08-31-18-46-13.gh-issu…
ofey404 Sep 3, 2022
1c6ed30
Filter remaining warnings.
ofey404 Sep 3, 2022
4881855
Add deprecated info in documentation.
ofey404 Sep 6, 2022
0158816
Use versionchanged instead of deprecated.
ofey404 Sep 7, 2022
8152b7c
Update Doc/reference/expressions.rst
ofey404 Sep 9, 2022
670d8f8
more docs and what's new entry
ofey404 Sep 9, 2022
0c20b35
Edit what's new.
ofey404 Sep 10, 2022
ba9a87c
Update Objects/genobject.c
ofey404 Sep 13, 2022
7f1dd7f
Update Objects/genobject.c
ofey404 Sep 13, 2022
0b16455
Update Lib/test/test_generators.py
ofey404 Sep 13, 2022
e204cc6
Update Objects/genobject.c
ofey404 Sep 13, 2022
0873dc3
Reversed agen.athrow() documentation, and what's new with method link.
ofey404 Sep 20, 2022
4a1539c
Apply suggestions from code review
ofey404 Sep 22, 2022
85b67cb
Add DeprecationWarning, doc and what's new to agen.athrow
ofey404 Sep 22, 2022
22bb65b
Update acks, and doc of anextawaitable_throw
ofey404 Sep 22, 2022
7b786e4
Add test_async_gen_3_arg_deprecation_warning.
ofey404 Sep 24, 2022
198645a
Apply formatting suggestions from code review
ofey404 Sep 25, 2022
528031c
patchcheck.py passed
ofey404 Sep 25, 2022
53c74db
Merge branch 'main' into ofey404/deprecate-get-throw
ofey404 Sep 25, 2022
93db966
Update Misc/NEWS.d/next/Core and Builtins/2022-08-31-18-46-13.gh-issu…
ofey404 Sep 25, 2022
0e56eb9
assert that deprecation warning is emitted
iritkatriel Sep 25, 2022
8738273
stage, exploring how to capture deprecation warning rather than supre…
ofey404 Sep 28, 2022
31b2e9f
Revert "stage, exploring how to capture deprecation warning rather th…
ofey404 Sep 28, 2022
8b701d6
Merge pull request #6 from iritkatriel/pr96428
ofey404 Sep 28, 2022
70e1f28
Merge branch 'main' into ofey404/deprecate-get-throw
iritkatriel Sep 28, 2022
ed2e83a
fix test
iritkatriel Sep 28, 2022
03fc6e0
Add a warning in FutureIter_throw
ofey404 Sep 29, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
more docs and what's new entry
  • Loading branch information
ofey404 committed Sep 9, 2022
commit 670d8f8a188eb446ec85e304ab0ec6aa5ba556bb
5 changes: 5 additions & 0 deletions 5 Doc/reference/datamodel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Member

@merwok merwok Sep 30, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For future PRs, not that code should generally be marked up like

      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
Expand Down
8 changes: 7 additions & 1 deletion 8 Doc/reference/expressions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -743,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
Expand All @@ -755,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.
iritkatriel marked this conversation as resolved.
Show resolved Hide resolved

.. index:: exception: GeneratorExit


Expand Down
2 changes: 2 additions & 0 deletions 2 Doc/whatsnew/3.12.rst
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ Deprecated
and tailor them to your needs.
(Contributed by Erlend E. Aasland in :gh:`90016`.)

* The exception representation \(type\[, value\[, traceback\]\]\) is now deprecated. (:gh:`89874`.)
ofey404 marked this conversation as resolved.
Show resolved Hide resolved


Pending Removal in Python 3.13
------------------------------
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.