Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
Pyston
Commits
2f601718
Commit
2f601718
authored
Nov 19, 2014
by
Joris Vankerschaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Right multiplication for list and integer.
parent
9dc01580
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
0 deletions
+6
-0
src/runtime/list.cpp
src/runtime/list.cpp
+1
-0
test/tests/list.py
test/tests/list.py
+5
-0
No files found.
src/runtime/list.cpp
View file @
2f601718
...
...
@@ -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
)));
...
...
test/tests/list.py
View file @
2f601718
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment