We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9825d8a commit d08b04eCopy full SHA for d08b04e
vm/src/stdlib/builtins.rs
@@ -534,6 +534,22 @@ mod builtins {
534
iter_target.get_aiter(vm)
535
}
536
537
+ #[pyfunction]
538
+ fn anext(
539
+ aiter: PyObjectRef,
540
+ default_value: OptionalArg<PyObjectRef>,
541
+ vm: &VirtualMachine,
542
+ ) -> PyResult {
543
+ let awaitable = vm.call_method(&aiter, "__anext__", ())?;
544
+
545
+ if default_value.is_missing() {
546
+ Ok(awaitable)
547
+ } else {
548
+ // TODO: Implement CPython like PyAnextAwaitable to properly handle the default value.
549
550
+ }
551
552
553
#[pyfunction]
554
fn len(obj: PyObjectRef, vm: &VirtualMachine) -> PyResult<usize> {
555
obj.length(vm)
0 commit comments