From: Stefan Behnel Date: Wed, 19 Nov 2008 06:59:15 +0000 (+0100) Subject: extended for-loop test case X-Git-Tag: 0.11-beta~236 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=6d08381445dc252a5fc8d41c8b91d956e8afaa56;p=cython.git extended for-loop test case --- diff --git a/tests/run/r_forloop.pyx b/tests/run/r_forloop.pyx index 81bfab73..cfb4683a 100644 --- a/tests/run/r_forloop.pyx +++ b/tests/run/r_forloop.pyx @@ -4,21 +4,46 @@ __doc__ = u""" Spam! Spam! Spam! - Spam! >>> go_c() Spam! Spam! Spam! Spam! + + >>> go_list() + Spam! + Spam! + Spam! + Spam! + + >>> go_tuple() + Spam! + Spam! + Spam! Spam! """ def go_py(): - for i in range(5): + for i in range(4): print u"Spam!" def go_c(): cdef int i - for i in range(5): + for i in range(4): + print u"Spam!" + +def go_list(): + cdef list l = range(4) + for i in l: + print u"Spam!" + +def go_tuple(): + cdef tuple t = tuple(range(4)) + for i in t: + print u"Spam!" + +def go_dict(): + cdef dict d = dict(zip(range(4), range(4))) + for i in d: print u"Spam!"