Commit f75cad42 authored by Robert Bradshaw's avatar Robert Bradshaw

Fix bug when calling cdef append.

parent fbfadbbb
......@@ -2600,7 +2600,7 @@ class OptimizeBuiltinCalls(Visitor.NodeRefCleanupMixin,
"""Optimistic optimisation as X.append() is almost always
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 ExprNodes.PythonCapiCallNode(
......
......@@ -8,6 +8,16 @@ class B(list):
for arg in args:
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):
"""
......
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