Skip to content

Commit 6af4e6b

Browse files
eriknwsweeneyde
andauthored
bpo-43918: document signature and default argument of anext builtin (#25551)
Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
1 parent a6b47de commit 6af4e6b

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Document the signature and ``default`` argument in the docstring of the new ``anext`` builtin.

Python/bltinmodule.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1631,13 +1631,16 @@ anext as builtin_anext
16311631
default: object = NULL
16321632
/
16331633
1634-
Return the next item from the async iterator.
1634+
async anext(aiterator[, default])
1635+
1636+
Return the next item from the async iterator. If default is given and the async
1637+
iterator is exhausted, it is returned instead of raising StopAsyncIteration.
16351638
[clinic start generated code]*/
16361639

16371640
static PyObject *
16381641
builtin_anext_impl(PyObject *module, PyObject *aiterator,
16391642
PyObject *default_value)
1640-
/*[clinic end generated code: output=f02c060c163a81fa input=699d11f4e38eca24]*/
1643+
/*[clinic end generated code: output=f02c060c163a81fa input=8f63f4f78590bb4c]*/
16411644
{
16421645
PyTypeObject *t;
16431646
PyObject *awaitable;

Python/clinic/bltinmodule.c.h

Lines changed: 5 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)