diff --git a/vm/src/stdlib/collections.rs b/vm/src/stdlib/collections.rs index a4446ed2c7..7f5d8c3ad5 100644 --- a/vm/src/stdlib/collections.rs +++ b/vm/src/stdlib/collections.rs @@ -471,6 +471,16 @@ mod _collections { }) } + #[pymethod(magic)] + fn imul(zelf: PyRef, value: isize, vm: &VirtualMachine) -> PyResult> { + let mul_deque = zelf.mul(value, vm)?; + std::mem::swap( + &mut *zelf.borrow_deque_mut(), + &mut *mul_deque.borrow_deque_mut(), + ); + Ok(zelf) + } + #[pymethod(magic)] fn len(&self) -> usize { self.borrow_deque().len()