-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add aiter
and anext
builtin function
#3609
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
Comments
static PyObject *
builtin_anext_impl(PyObject *module, PyObject *aiterator,
PyObject *default_value)
{
// ...skip
awaitable = (*t->tp_as_async->am_anext)(aiterator);
if (default_value == NULL) {
return awaitable;
}
PyObject* new_awaitable = PyAnextAwaitable_New(
awaitable, default_value);
Py_DECREF(awaitable);
return new_awaitable;
} |
Thanks for the "good for issue". I am probably misunderstanding things. |
@sum12 you are right. that's the right way. But instead of the right way, you can implement it by calling If you are interested in the right way, You can do it by looking at other slots, like |
relates RustPython#3609
the caller is expected to make sure that the passed in object does in fact supports the protocol relates RustPython#3609
the caller is expected to make sure that the passed in object does in fact supports the protocol relates RustPython#3609
Feature
builtins.aiter
: https://docs.python.org/3/library/functions.html#aiter implement aiter #3646builtins.anext
: https://docs.python.org/3/library/functions.html#anext (See @Snowapril 's comment)Python Documentation
The text was updated successfully, but these errors were encountered: