From 484b5d8cca2ef3398cbd3d7f74246724cefb5a02 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Fri, 10 Apr 2009 08:56:37 +0200 Subject: [PATCH] extended test case --- tests/errors/extended_unpacking.pyx | 36 +++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/tests/errors/extended_unpacking.pyx b/tests/errors/extended_unpacking.pyx index 872be2b7..bdcb69df 100644 --- a/tests/errors/extended_unpacking.pyx +++ b/tests/errors/extended_unpacking.pyx @@ -3,7 +3,6 @@ def syntax1(): a = b = c = d = e = f = g = h = i = 1 # prevent undefined names - list_of_sequences = [[1,2], [3,4]] *a @@ -17,18 +16,35 @@ def syntax1(): (a, b, *c, d, e, f, *g, h, i) + +def syntax2(): + list_of_sequences = [[1,2], [3,4]] + for *a,*b in list_of_sequences: pass +def types(l): + cdef int a,b + a, *b = (1,2,3,4) + a, *b = l + + _ERRORS = u""" - 8: 4: can use starred expression only as assignment target -10: 4: can use starred expression only as assignment target -12: 4: can use starred expression only as assignment target -14: 4: can use starred expression only as assignment target -16: 5: can use starred expression only as assignment target -16: 9: can use starred expression only as assignment target -18:11: can use starred expression only as assignment target -18:24: can use starred expression only as assignment target -20:11: more than 1 starred expression in assignment +# syntax1() + 7: 4: can use starred expression only as assignment target + 9: 4: can use starred expression only as assignment target +11: 4: can use starred expression only as assignment target +13: 4: can use starred expression only as assignment target +15: 5: can use starred expression only as assignment target +15: 9: can use starred expression only as assignment target +17:11: can use starred expression only as assignment target +17:24: can use starred expression only as assignment target + +# syntax2() +23:11: more than 1 starred expression in assignment + +# types() +29:15: Cannot coerce list to type 'int' +30:10: starred target must have Python object (list) type """ -- 2.26.2