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
47fb329a
Commit
47fb329a
authored
Nov 25, 2010
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test case for ticket #600: scope of iterable in genexprs
parent
03f1a3ce
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
0 deletions
+19
-0
tests/bugs.txt
tests/bugs.txt
+1
-0
tests/run/genexpr_iterable_lookup_T600.pyx
tests/run/genexpr_iterable_lookup_T600.pyx
+18
-0
No files found.
tests/bugs.txt
View file @
47fb329a
...
@@ -18,6 +18,7 @@ closure_inside_cdef_T554
...
@@ -18,6 +18,7 @@ closure_inside_cdef_T554
ipow_crash_T562
ipow_crash_T562
pure_mode_cmethod_inheritance_T583
pure_mode_cmethod_inheritance_T583
list_comp_in_closure_T598
list_comp_in_closure_T598
genexpr_iterable_lookup_T600
# CPython regression tests that don't current work:
# CPython regression tests that don't current work:
pyregr.test_threadsignals
pyregr.test_threadsignals
...
...
tests/run/genexpr_iterable_lookup_T600.pyx
0 → 100644
View file @
47fb329a
cimport
cython
@
cython
.
test_assert_path_exists
(
'//ComprehensionNode'
)
@
cython
.
test_fail_if_path_exists
(
'//SimpleCallNode'
)
def
list_genexpr_iterable_lookup
():
"""
>>> x = (0,1,2,3,4,5)
>>> [ x*2 for x in x if x % 2 == 0 ] # leaks in Py2 but finds the right 'x'
[0, 4, 8]
>>> list_genexpr_iterable_lookup()
[0, 4, 8]
"""
x
=
(
0
,
1
,
2
,
3
,
4
,
5
)
result
=
list
(
x
*
2
for
x
in
x
if
x
%
2
==
0
)
assert
x
==
(
0
,
1
,
2
,
3
,
4
,
5
)
return
result
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