fixed a bug with tuple indexing: a,b,c = (1,2)

This commit is contained in:
David Halter
2012-07-12 15:45:14 +02:00
parent cc081cdb3c
commit c84ca8f897
2 changed files with 25 additions and 2 deletions

View File

@@ -969,7 +969,10 @@ def assign_tuples(tup, results, seek_name):
types = []
for r in results:
if hasattr(r, "get_exact_index_types"):
try:
types += r.get_exact_index_types(index)
except IndexError:
pass
else:
debug.warning("invalid tuple lookup %s of result %s in %s"
% (tup, results, seek_name))

View File

@@ -6,6 +6,10 @@
[1,""][0]
#? str()
[1,""][1]
#? int() str()
[1,""][2]
#? int() str()
[1,""][20]
a = list()
#? list()
@@ -92,7 +96,7 @@ u1
(u1)
# -----------------
# should fail (return nothing)
# imbalanced sides
# -----------------
(f, g) = (1,)
#? int()
@@ -100,12 +104,26 @@ f
#? []
g.
(f, g, h) = (1,'')
#? int()
f
#? str()
g
#? []
h.
(f1, g1) = 1
#? []
f1.
#? []
g1.
(f, g) = (1,'',1.0)
#? int()
f
#? str()
g
# -----------------
# dicts
# -----------------
@@ -118,3 +136,5 @@ dic2['asdf']
dic2[r'asdf']
#? int()
dic2[r'asdf']
#? int() str()
dic2['just_something']