We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3f8eb24 commit 5786a06Copy full SHA for 5786a06
vm/src/stdlib/itertools.rs
@@ -221,13 +221,12 @@ mod decl {
221
222
#[pymethod(magic)]
223
fn repr(&self, vm: &VirtualMachine) -> PyResult<String> {
224
- let mut cur = format!("{}", self.cur.read().clone().repr(vm)?);
225
- let step = format!("{}", self.step.clone());
226
- if step != "1" {
227
- cur.push_str(", ");
228
- cur.push_str(&step);
+ let cur = format!("{}", self.cur.read().clone().repr(vm)?);
+ let step = self.step.as_u32_mask().clone();
+ if step == 1 {
+ return Ok(format!("count({})", cur));
229
}
230
- Ok(format!("count({})", cur))
+ Ok(format!("count({}, {})", cur, step.to_string()))
231
232
233
impl IterNextIterable for PyItertoolsCount {}
0 commit comments