mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-02 19:39:49 +09:00
Add itertools count repr (#3784)
This commit is contained in:
@@ -202,6 +202,13 @@ mod decl {
|
||||
fn reduce(zelf: PyRef<Self>) -> (PyTypeRef, (BigInt,)) {
|
||||
(zelf.class().clone(), (zelf.cur.read().clone(),))
|
||||
}
|
||||
|
||||
#[pymethod(magic)]
|
||||
fn repr(&self) -> PyResult<String> {
|
||||
let cur = self.cur.read();
|
||||
|
||||
Ok(format!("count({})", cur))
|
||||
}
|
||||
}
|
||||
impl IterNextIterable for PyItertoolsCount {}
|
||||
impl IterNext for PyItertoolsCount {
|
||||
|
||||
Reference in New Issue
Block a user