You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Remove yield from usage from asyncio tests #100113
There are a few yield from in asyncio tests (Lib/test/test_asyncio/):
test_futures.py:296: x = yield from f
test_futures.py:298: y = yield from f
test_futures.py:303: self.assertEqual(next(g), f) # First yield from f.
test_futures.py:306: # The second "yield from f" does not yield f.
test_futures.py:408: yield from fut
test_pep492.py:152: yield from ()
test_sslproto.py:99: # yield from waiter hang if lost_connection was called.
test_tasks.py:2096: return (yield from fut)
utils.py:271: yield from _run_test_server(address=path, use_ssl=use_ssl,
utils.py:278: yield from _run_test_server(address=(host, port), use_ssl=use_ssl,
There are a few yield from in asyncio tests (Lib/test/test_asyncio/):
I think those are testing the internal implementation of futures and they are not used with asyncio APIs. I don't think they should be changed to await.
There's a comment referencing yield from on line 66 of asyncio/futures.py that probably should be updated, if indeed we are dropping (or have dropped) yield from support. Similar on line 292 (seems to refer to the same thing).
Next, in asyncio/tasks.py, line 316 there's an error message complaining about yield instead of yield from. Should that be await too? Again on line 327. The same error messages also occur in _asynciomodule.c.
Then there's _wrap_awaitable(), also in tasks.py, which on line 687 has a yield from.
But maybe I'm not understanding how yield from is used here???
Then there's _wrap_awaitable(), also in tasks.py, which on line 687 has a yield from.
This has been removed now.
Next, in asyncio/tasks.py, line 316 there's an error message complaining about yield instead of yield from. Should that be await too? Again on line 327. The same error messages also occur in _asynciomodule.c.
That's debugging aid for people who are writing their own awaitables with custom __await__ method.
Activity
vstinner commentedon Dec 8, 2022
There are a few
yield fromin asyncio tests (Lib/test/test_asyncio/):GH-100113: remove remaining `yield from` usage from `asyncio` tests (#…
kumaraditya303 commentedon Dec 9, 2022
I think those are testing the internal implementation of futures and they are not used with asyncio APIs. I don't think they should be changed to await.
gvanrossum commentedon Dec 10, 2022
There's a comment referencing
yield fromon line 66 of asyncio/futures.py that probably should be updated, if indeed we are dropping (or have dropped)yield fromsupport. Similar on line 292 (seems to refer to the same thing).Next, in asyncio/tasks.py, line 316 there's an error message complaining about
yieldinstead ofyield from. Should that beawaittoo? Again on line 327. The same error messages also occur in _asynciomodule.c.Then there's
_wrap_awaitable(), also in tasks.py, which on line 687 has ayield from.But maybe I'm not understanding how
yield fromis used here???kumaraditya303 commentedon Mar 16, 2023
This has been removed now.
That's debugging aid for people who are writing their own awaitables with custom
__await__method.kumaraditya303 commentedon Mar 19, 2023
Closing this, anything left can be handled in #102748