Commit 2f601718 authored by Joris Vankerschaver's avatar Joris Vankerschaver

Right multiplication for list and integer.

parent 9dc01580
......@@ -593,6 +593,7 @@ void setupList() {
list_cls->giveAttr("insert", new BoxedFunction(boxRTFunction((void*)listInsert, NONE, 3)));
list_cls->giveAttr("__mul__", new BoxedFunction(boxRTFunction((void*)listMul, LIST, 2)));
list_cls->giveAttr("__rmul__", new BoxedFunction(boxRTFunction((void*)listMul, LIST, 2)));
list_cls->giveAttr("__iadd__", new BoxedFunction(boxRTFunction((void*)listIAdd, UNKNOWN, 2)));
list_cls->giveAttr("__add__", new BoxedFunction(boxRTFunction((void*)listAdd, UNKNOWN, 2)));
......
......@@ -71,3 +71,8 @@ while l:
l = range(5)
l.extend(range(5))
print l
# Repeating a list
x = [0, 1, 2]
print 2 * x
print x * 2
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment