Skip to content

Commit 27a0d3a

Browse files
committed
Update itertools count repr
1 parent 5786a06 commit 27a0d3a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

vm/src/stdlib/itertools.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ mod decl {
1717
AsObject, Py, PyObjectRef, PyPayload, PyRef, PyResult, PyWeakRef, VirtualMachine,
1818
};
1919
use crossbeam_utils::atomic::AtomicCell;
20-
use num_traits::{Signed, ToPrimitive};
20+
use num_traits::{Signed, ToPrimitive, One};
2121
use std::fmt;
2222

2323
#[pyattr]
@@ -222,8 +222,8 @@ mod decl {
222222
#[pymethod(magic)]
223223
fn repr(&self, vm: &VirtualMachine) -> PyResult<String> {
224224
let cur = format!("{}", self.cur.read().clone().repr(vm)?);
225-
let step = self.step.as_u32_mask().clone();
226-
if step == 1 {
225+
let step = self.step.as_bigint();
226+
if step.is_one() {
227227
return Ok(format!("count({})", cur));
228228
}
229229
Ok(format!("count({}, {})", cur, step.to_string()))

0 commit comments

Comments
 (0)