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
Kirill Smelkov
cython
Commits
111d4bca
Commit
111d4bca
authored
Mar 08, 2013
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add another failing test for iterable lookup in generators
parent
fca79325
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
0 deletions
+33
-0
runtests.py
runtests.py
+1
-0
tests/bugs.txt
tests/bugs.txt
+1
-0
tests/run/generator_expressions_in_class.py
tests/run/generator_expressions_in_class.py
+31
-0
No files found.
runtests.py
View file @
111d4bca
...
...
@@ -200,6 +200,7 @@ VER_DEP_MODULES = {
'run.all',
'run.yield_from_pep380', # GeneratorExit
'run.generator_frame_cycle', # yield in try-finally
'run.generator_expressions_in_class',
'run.relativeimport_T542',
'run.relativeimport_star_T542',
'run.initial_file_path', # relative import
...
...
tests/bugs.txt
View file @
111d4bca
...
...
@@ -8,6 +8,7 @@ cfunc_call_tuple_args_T408
cpp_structs
closure_inside_cdef_T554
genexpr_iterable_lookup_T600
generator_expressions_in_class
for_from_pyvar_loop_T601
temp_sideeffects_T654 # not really a bug, Cython warns about it
slice2_T636
...
...
tests/run/generator_expressions_in_class.py
0 → 100644
View file @
111d4bca
# mode: run
# tag: generators
class
TestClass
(
object
):
"""
>>> TestClass.x
[1, 2, 3]
>>> list(TestClass.gen)
[]
>>> TestClass.gen_result
[2, 4, 6]
>>> TestClass.test
True
>>> list(TestClass.gen3)
[2, 4, 6, 8, 10, 12]
"""
x
=
[
1
,
2
,
3
]
gen
=
(
i
*
2
for
i
in
x
)
test
=
all
(
i
*
2
for
i
in
x
)
gen_result
=
list
(
gen
)
nested_list
=
[[
1
,
2
,
3
],
[
4
,
5
,
6
]]
#gen2 = (i * 2 for i in x for x in nested_list) # move to error test
gen3
=
(
i
*
2
for
x
in
nested_list
for
i
in
x
)
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