diff --git a/jedi/evaluate/context/iterable.py b/jedi/evaluate/context/iterable.py index ab3d4308..538e08c7 100644 --- a/jedi/evaluate/context/iterable.py +++ b/jedi/evaluate/context/iterable.py @@ -584,7 +584,7 @@ def unpack_tuple_to_dict(context, types, exprlist): """ if exprlist.type == 'name': return {exprlist.value: types} - elif exprlist.type == 'atom' and exprlist.children[0] in '([': + elif exprlist.type == 'atom' and exprlist.children[0] in ('(', '['): return unpack_tuple_to_dict(context, types, exprlist.children[1]) elif exprlist.type in ('testlist', 'testlist_comp', 'exprlist', 'testlist_star_expr'): diff --git a/test/completion/basic.py b/test/completion/basic.py index 14cfc6e9..ff5ed10e 100644 --- a/test/completion/basic.py +++ b/test/completion/basic.py @@ -79,6 +79,11 @@ for a3, b3 in (1,""), (1,""), (1,""): a3 #? str() b3 +for (a3, b3) in (1,""), (1,""), (1,""): + #? int() + a3 + #? str() + b3 for a4, (b4, c4) in (1,("", list)), (1,("", list)): #? int() diff --git a/test/completion/comprehensions.py b/test/completion/comprehensions.py index e66858e0..5a4c0a76 100644 --- a/test/completion/comprehensions.py +++ b/test/completion/comprehensions.py @@ -27,6 +27,9 @@ a[0] a = [a for a,b in [(1,'')]] #? int() a[0] +a = [a for (a,b) in [(1,'')]] +#? int() +a[0] arr = [1,''] a = [a for a in arr]