mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-10 07:41:51 +08:00
Fix tuple unpacking for special case
This commit is contained in:
@@ -584,7 +584,7 @@ def unpack_tuple_to_dict(context, types, exprlist):
|
|||||||
"""
|
"""
|
||||||
if exprlist.type == 'name':
|
if exprlist.type == 'name':
|
||||||
return {exprlist.value: types}
|
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])
|
return unpack_tuple_to_dict(context, types, exprlist.children[1])
|
||||||
elif exprlist.type in ('testlist', 'testlist_comp', 'exprlist',
|
elif exprlist.type in ('testlist', 'testlist_comp', 'exprlist',
|
||||||
'testlist_star_expr'):
|
'testlist_star_expr'):
|
||||||
|
|||||||
@@ -79,6 +79,11 @@ for a3, b3 in (1,""), (1,""), (1,""):
|
|||||||
a3
|
a3
|
||||||
#? str()
|
#? str()
|
||||||
b3
|
b3
|
||||||
|
for (a3, b3) in (1,""), (1,""), (1,""):
|
||||||
|
#? int()
|
||||||
|
a3
|
||||||
|
#? str()
|
||||||
|
b3
|
||||||
|
|
||||||
for a4, (b4, c4) in (1,("", list)), (1,("", list)):
|
for a4, (b4, c4) in (1,("", list)), (1,("", list)):
|
||||||
#? int()
|
#? int()
|
||||||
|
|||||||
@@ -27,6 +27,9 @@ a[0]
|
|||||||
a = [a for a,b in [(1,'')]]
|
a = [a for a,b in [(1,'')]]
|
||||||
#? int()
|
#? int()
|
||||||
a[0]
|
a[0]
|
||||||
|
a = [a for (a,b) in [(1,'')]]
|
||||||
|
#? int()
|
||||||
|
a[0]
|
||||||
|
|
||||||
arr = [1,'']
|
arr = [1,'']
|
||||||
a = [a for a in arr]
|
a = [a for a in arr]
|
||||||
|
|||||||
Reference in New Issue
Block a user