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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
55cf301b
Commit
55cf301b
authored
Aug 29, 2008
by
Dag Sverre Seljebotn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed gcc warning with list comprehensions
Ticket 65
parent
213f561f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
1 deletion
+17
-1
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+1
-1
tests/run/listcomp.pyx
tests/run/listcomp.pyx
+16
-0
No files found.
Cython/Compiler/ExprNodes.py
View file @
55cf301b
...
...
@@ -2619,7 +2619,7 @@ class ListComprehensionAppendNode(ExprNode):
self
.
is_temp
=
1
def
generate_result_code
(
self
,
code
):
code
.
putln
(
"%s = PyList_Append(%s, %s); %s"
%
code
.
putln
(
"%s = PyList_Append(%s,
(PyObject*)
%s); %s"
%
(
self
.
result_code
,
self
.
target
.
result_code
,
self
.
expr
.
result_code
,
...
...
tests/run/listcomp.pyx
0 → 100644
View file @
55cf301b
u"""
>>> smoketest()
[0, 4, 8]
>>> typed()
[A, A, A]
"""
def
smoketest
():
print
[
x
*
2
for
x
in
range
(
5
)
if
x
%
2
==
0
]
cdef
class
A
:
def
__repr__
(
self
):
return
"A"
def
typed
():
cdef
A
obj
print
[
obj
for
obj
in
[
A
(),
A
(),
A
()]]
\ No newline at end of file
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