From c211402a76adc265a5d854c6fec949afa7e81d9b Mon Sep 17 00:00:00 2001 From: Tony Jinwoo Ahn Date: Wed, 1 Sep 2021 23:38:00 +0900 Subject: [PATCH] Add documentation for a pymethod in map.rs Signed-off-by: Tony Jinwoo Ahn --- vm/src/builtins/map.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vm/src/builtins/map.rs b/vm/src/builtins/map.rs index 177a76efd..d99b367df 100644 --- a/vm/src/builtins/map.rs +++ b/vm/src/builtins/map.rs @@ -8,7 +8,7 @@ use crate::{PyClassImpl, PyContext, PyObjectRef, PyRef, PyResult, PyValue}; /// map(func, *iterables) --> map object /// /// Make an iterator that computes the function using arguments from -/// each of the iterables. Stops when the shortest iterable is exhausted. +/// each of the iterables. Stops when the shortest iterable is exhausted. #[pyclass(module = false, name = "map")] #[derive(Debug)] pub struct PyMap { @@ -42,6 +42,7 @@ impl PyMap { .into_ref_with_type(vm, cls) } + /// Return an estimate of the number of items. #[pymethod(magic)] fn length_hint(&self, vm: &VirtualMachine) -> PyResult { self.iterators.iter().try_fold(0, |prev, cur| {