bpo-31861: Add aiter and anext to builtins #23847
Conversation
...on top of latest master. Also drop now-removed `loop` kwarg from asyncio.sleep call. Ref: https://bugs.python.org/issue42392
|
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA). Recognized GitHub usernameWe couldn't find a bugs.python.org (b.p.o) account corresponding to the following GitHub usernames: This might be simply due to a missing "GitHub Name" entry in one's b.p.o account settings. This is necessary for legal reasons before we can look at this contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. You can check yourself to see if the CLA has been received. Thanks again for the contribution, we look forward to reviewing it! |
| /* Can we raise this at this point, or do we need to return an awaitable | ||
| * that raises it? */ | ||
| PyErr_SetNone(PyExc_StopAsyncIteration); |
eric-wieser
Dec 19, 2020
Contributor
I assume this comment is for reviewers, and should be removed / addressed before merging? If so, leaving this comment as a marker for someone who knows more.
|
IMO, this looks like it should be in whatsnew too under this section. It's not everyday two new builtins get added :). Maybe something like * Two new builtin functions -- :func:`aiter` and :func:`anext` have been added
to provide asynchronous counterparts to :func:`iter` and :func:`anext`
respectively.
(Contributed by Joshua Bronson, Justin Wang and Daniel Pope in :issue:`31861`.) |
|
I agree, a whatsnew entry is required in this case. I will ping @1st1 for a look. |
This comment has been minimized.
This comment has been minimized.
|
This isn't right, is it? I though argument clinic gave us NULL if we make that the default? |
This comment has been minimized.
This comment has been minimized.
|
I changed the default to |
This comment has been minimized.
This comment has been minimized.
|
Yeah this is wrong - |
|
LGTM |
This is the C implementation for bpo-31861 requested as an alternative to the Python implementation provided in #8895.
For a more direct translation of this into Python (in case it makes reviewing easier), see jab@ce35092.
Patch by @justin39, @lordmauve, and me.
https://bugs.python.org/issue31861