mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-09 22:49:57 +09:00
implement aiter
the caller is expected to make sure that the passed in object does in fact supports the protocol relates #3609
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user