Skip to content

Commit 208b37a

Browse files
author
Adolfo Gonzalez III
committed
Merged
1 parent 6768e3a commit 208b37a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

vm/src/obj/objlist.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@ impl PyListRef {
167167
fn reverse(self, _vm: &VirtualMachine) {
168168
self.elements.borrow_mut().reverse();
169169
}
170-
171170
fn reversed(self, _vm: &VirtualMachine) -> PyListReverseIterator {
172171
let final_position = self.elements.borrow().len();
173172
PyListReverseIterator {
@@ -406,6 +405,10 @@ impl PyListRef {
406405
vm.ctx.new_list(new_elements)
407406
}
408407

408+
fn rmul(self, counter: isize, vm: &VirtualMachine) -> PyObjectRef {
409+
self.mul(counter, &vm)
410+
}
411+
409412
fn imul(self, counter: isize, _vm: &VirtualMachine) -> Self {
410413
let new_elements = seq_mul(&self.elements.borrow().as_slice(), counter)
411414
.cloned()
@@ -878,6 +881,7 @@ pub fn init(context: &PyContext) {
878881
"__setitem__" => context.new_rustfunc(PyListRef::setitem),
879882
"__reversed__" => context.new_rustfunc(PyListRef::reversed),
880883
"__mul__" => context.new_rustfunc(PyListRef::mul),
884+
"__rmul__" => context.new_rustfunc(PyListRef::rmul),
881885
"__imul__" => context.new_rustfunc(PyListRef::imul),
882886
"__len__" => context.new_rustfunc(PyListRef::len),
883887
"__new__" => context.new_rustfunc(list_new),

0 commit comments

Comments
 (0)