mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-29 11:14:38 +08:00
Add itertools count repr (#3784)
This commit is contained in:
1 parent
f624e8e78b
commit
7848e06a41
1 file changed
+7
@@ -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