Commit 111d4bca authored by Stefan Behnel's avatar Stefan Behnel

add another failing test for iterable lookup in generators

parent fca79325
......@@ -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
......
......@@ -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
......
# 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)
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