diff --git a/test/completion/arrays.py b/test/completion/arrays.py index 2f23a2ce..8be1cece 100644 --- a/test/completion/arrays.py +++ b/test/completion/arrays.py @@ -366,8 +366,6 @@ tuple(a)[1] #? int() str() tuple(list(set(a)))[1] -#? int() -tuple({1})[0] #? int() tuple((1,))[0] @@ -404,6 +402,12 @@ def test_func(): #? str() x + +# python >= 2.7 +# Set literals are not valid in 2.6. +#? int() +tuple({1})[0] + # python >= 3.3 # ----------------- # PEP 3132 Extended Iterable Unpacking (star unpacking) diff --git a/test/completion/dynamic_arrays.py b/test/completion/dynamic_arrays.py index 19cb920f..9be530fa 100644 --- a/test/completion/dynamic_arrays.py +++ b/test/completion/dynamic_arrays.py @@ -48,18 +48,6 @@ for a in arr: #? float() str() list(arr)[10] -# ----------------- -# set.add -# ----------------- -st = {1.0} -for a in [1,2]: - st.add(a) - -st.append('') # lists should not have an influence - -st.add # should not cause an exception -st.add() - # ----------------- # list.extend / set.update # ----------------- @@ -103,15 +91,6 @@ arr2.append('') arr2[0] -st = {1.0} -st.add(1) -lst = list(st) - -lst.append('') - -#? float() int() str() -lst[0] - lst = [1] lst.append(1.0) s = set(lst) @@ -304,3 +283,28 @@ def third(): return list(b) #? third()[0] + + +# ----------------- +# set.add +# ----------------- +# Set literals are not valid in 2.6. +# python >= 2.7 +st = {1.0} +for a in [1,2]: + st.add(a) + +st.append('') # lists should not have an influence + +st.add # should not cause an exception +st.add() + +st = {1.0} +st.add(1) +lst = list(st) + +lst.append('') + +#? float() int() str() +lst[0] + diff --git a/test/completion/types.py b/test/completion/types.py index 768b6602..2ef01f9a 100644 --- a/test/completion/types.py +++ b/test/completion/types.py @@ -91,19 +91,6 @@ d.items()[0][0] #? int() d.items()[0][1] -# ----------------- -# set -# ----------------- -set_t = {1,2} - -#? ['clear', 'copy'] -set_t.c - -set_t2 = set() - -#? ['clear', 'copy'] -set_t2.c - # ----------------- # tuples # ----------------- @@ -125,3 +112,18 @@ tup3.index tup4 = 1,"" #? ['index'] tup4.index + +# ----------------- +# set +# ----------------- +# Set literals are not valid in 2.6. +# python >= 2.7 +set_t = {1,2} + +#? ['clear', 'copy'] +set_t.c + +set_t2 = set() + +#? ['clear', 'copy'] +set_t2.c diff --git a/test/completion/usages.py b/test/completion/usages.py index eabce568..55891b7f 100644 --- a/test/completion/usages.py +++ b/test/completion/usages.py @@ -295,6 +295,9 @@ x = 32 #< 7 (0,1), (0,7) [x for x in something] +x = 3 +# Not supported syntax in Python 2.6. +# python >= 2.7 #< 1 (0,1), (0,10) {x:1 for x in something} #< 10 (0,1), (0,10)