From d4d809306563855d574d51f77722cec3835cadbd Mon Sep 17 00:00:00 2001 From: Dag Sverre Seljebotn Date: Sun, 20 Jul 2008 19:03:31 +0200 Subject: [PATCH] Test case for for-loop assignment to buffer --- tests/run/bufaccess.pyx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/run/bufaccess.pyx b/tests/run/bufaccess.pyx index 14981d9e..d30baafb 100644 --- a/tests/run/bufaccess.pyx +++ b/tests/run/bufaccess.pyx @@ -39,6 +39,17 @@ __doc__ = u""" acquired A 0 1 2 3 4 5 released A + + #>>> forin_assignment([A, B, A], 3) + acquired A + 3 + released A + acquired B + 3 + released B + acquired A + 3 + released A >>> printbuf_float(MockBuffer("f", [1.0, 1.25, 0.75, 1.0]), (4,)) acquired @@ -99,6 +110,11 @@ def cdef_assignment(obj, n): print buf[i], print +def forin_assignment(objs, int pick): + cdef object[int] buf + for buf in objs: + print buf[pick] + def printbuf_float(o, shape): # should make shape builtin cdef object[float] buf -- 2.26.2