Skip to content

Commit 8455c74

Browse files
committed
implement aiter
the caller is expected to make sure that the passed in object does in fact supports the protocol relates RustPython#3609
1 parent 9a8e385 commit 8455c74

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

vm/src/stdlib/builtins.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,11 @@ mod builtins {
426426
}
427427
}
428428

429+
#[pyfunction]
430+
fn aiter(iter_target: PyObjectRef, vm: &VirtualMachine) -> PyResult {
431+
vm.call_special_method(iter_target, "__aiter__", ())
432+
}
433+
429434
#[pyfunction]
430435
fn len(obj: PyObjectRef, vm: &VirtualMachine) -> PyResult<usize> {
431436
obj.length(vm)

0 commit comments

Comments
 (0)