Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
implement aiter
the caller is expected to make sure that the passed in object does in
fact supports the protocol

relates #3609
  • Loading branch information
sum12 committed Apr 21, 2022
commit 8455c741a644a1741ad37d9271b902da628cfa3f
5 changes: 5 additions & 0 deletions vm/src/stdlib/builtins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,11 @@ mod builtins {
}
}

#[pyfunction]
fn aiter(iter_target: PyObjectRef, vm: &VirtualMachine) -> PyResult {
vm.call_special_method(iter_target, "__aiter__", ())
}

#[pyfunction]
fn len(obj: PyObjectRef, vm: &VirtualMachine) -> PyResult<usize> {
obj.length(vm)
Expand Down