Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
cython
Commits
f75cad42
Commit
f75cad42
authored
Jul 13, 2015
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bug when calling cdef append.
parent
fbfadbbb
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
Cython/Compiler/Optimize.py
Cython/Compiler/Optimize.py
+1
-1
tests/run/append.pyx
tests/run/append.pyx
+10
-0
No files found.
Cython/Compiler/Optimize.py
View file @
f75cad42
...
@@ -2600,7 +2600,7 @@ class OptimizeBuiltinCalls(Visitor.NodeRefCleanupMixin,
...
@@ -2600,7 +2600,7 @@ class OptimizeBuiltinCalls(Visitor.NodeRefCleanupMixin,
"""Optimistic optimisation as X.append() is almost always
"""Optimistic optimisation as X.append() is almost always
referring to a list.
referring to a list.
"""
"""
if
len
(
args
)
!=
2
or
node
.
result_is_used
:
if
function
.
type
.
is_cfunction
or
len
(
args
)
!=
2
or
node
.
result_is_used
:
return
node
return
node
return
ExprNodes
.
PythonCapiCallNode
(
return
ExprNodes
.
PythonCapiCallNode
(
...
...
tests/run/append.pyx
View file @
f75cad42
...
@@ -8,6 +8,16 @@ class B(list):
...
@@ -8,6 +8,16 @@ class B(list):
for
arg
in
args
:
for
arg
in
args
:
list
.
append
(
self
,
arg
)
list
.
append
(
self
,
arg
)
cdef
class
C
:
"""
>>> c = C(100)
appending 100
"""
def
__init__
(
self
,
value
):
self
.
append
(
value
)
cdef
append
(
self
,
value
):
print
u"appending"
,
value
return
value
def
test_append
(
L
):
def
test_append
(
L
):
"""
"""
...
...
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