summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorJoshua Bronson <jabronson@gmail.com>2021-03-23 22:47:21 (GMT)
committerGitHub <noreply@github.com>2021-03-23 22:47:21 (GMT)
commitf0a6fde8827d5d4f7a1c741ab1a8b206b66ffd57 (patch)
tree8ce99219dd179cef43115c42646ef8840e55d68c /Include
parent94faa0724f8cbae6867c491c8e465e35f4fdbfbb (diff)
downloadcpython-f0a6fde8827d5d4f7a1c741ab1a8b206b66ffd57.zip
cpython-f0a6fde8827d5d4f7a1c741ab1a8b206b66ffd57.tar.gz
cpython-f0a6fde8827d5d4f7a1c741ab1a8b206b66ffd57.tar.bz2
bpo-31861: Add aiter and anext to builtins (#23847)
Co-authored-by: jab <jab@users.noreply.github.com> Co-authored-by: Daniel Pope <mauve@mauveweb.co.uk> Co-authored-by: Justin Wang <justin39@gmail.com>
Diffstat (limited to 'Include')
-rw-r--r--Include/abstract.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/Include/abstract.h b/Include/abstract.h
index a47c944..1af1487 100644
--- a/Include/abstract.h
+++ b/Include/abstract.h
@@ -324,11 +324,21 @@ PyAPI_FUNC(PyObject *) PyObject_Format(PyObject *obj,
returns itself. */
PyAPI_FUNC(PyObject *) PyObject_GetIter(PyObject *);
+/* Takes an AsyncIterable object and returns an AsyncIterator for it.
+ This is typically a new iterator but if the argument is an AsyncIterator,
+ this returns itself. */
+PyAPI_FUNC(PyObject *) PyObject_GetAiter(PyObject *);
+
/* Returns non-zero if the object 'obj' provides iterator protocols, and 0 otherwise.
This function always succeeds. */
PyAPI_FUNC(int) PyIter_Check(PyObject *);
+/* Returns non-zero if the object 'obj' provides AsyncIterator protocols, and 0 otherwise.
+
+ This function always succeeds. */
+PyAPI_FUNC(int) PyAiter_Check(PyObject *);
+
/* Takes an iterator object and calls its tp_iternext slot,
returning the next value.