From: Stefan Behnel Date: Sat, 2 Apr 2011 09:58:08 +0000 (+0200) Subject: added disabled test case for type inference in generators X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=fb3ac0765d30d8d1d3a4ac700d992716f2d14e00;p=cython.git added disabled test case for type inference in generators --- diff --git a/tests/bugs.txt b/tests/bugs.txt index c8845007..f1478a3b 100644 --- a/tests/bugs.txt +++ b/tests/bugs.txt @@ -18,6 +18,7 @@ genexpr_iterable_lookup_T600 for_from_pyvar_loop_T601 decorators_T593 temp_sideeffects_T654 +generator_type_inference # CPython regression tests that don't current work: pyregr.test_threadsignals diff --git a/tests/run/generator_type_inference.pyx b/tests/run/generator_type_inference.pyx new file mode 100644 index 00000000..d8c7c852 --- /dev/null +++ b/tests/run/generator_type_inference.pyx @@ -0,0 +1,13 @@ +# mode: run +# tag: typeinference, generators + +cimport cython + +def test_type_inference(): + """ + >>> [ item for item in test_type_inference() ] + [(2.0, 'double'), (2.0, 'double'), (2.0, 'double')] + """ + x = 1.0 + for i in range(3): + yield x * 2.0, cython.typeof(x)