forked from VimPlug/jedi
Recognize {**d} as a dict instead of set
This commit is contained in:
@@ -255,7 +255,8 @@ def eval_atom(context, atom):
|
|||||||
array_node_c = array_node.children
|
array_node_c = array_node.children
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
array_node_c = []
|
array_node_c = []
|
||||||
if c[0] == '{' and (array_node == '}' or ':' in array_node_c):
|
if c[0] == '{' and (array_node == '}' or ':' in array_node_c or
|
||||||
|
'**' in array_node_c):
|
||||||
context = iterable.DictLiteralContext(context.evaluator, context, atom)
|
context = iterable.DictLiteralContext(context.evaluator, context, atom)
|
||||||
else:
|
else:
|
||||||
context = iterable.SequenceLiteralContext(context.evaluator, context, atom)
|
context = iterable.SequenceLiteralContext(context.evaluator, context, atom)
|
||||||
|
|||||||
@@ -131,3 +131,11 @@ set_t2 = set()
|
|||||||
|
|
||||||
#? ['clear', 'copy']
|
#? ['clear', 'copy']
|
||||||
set_t2.c
|
set_t2.c
|
||||||
|
|
||||||
|
# -----------------
|
||||||
|
# pep 448 unpacking generalizations
|
||||||
|
# -----------------
|
||||||
|
# python >= 3.5
|
||||||
|
|
||||||
|
#? dict()
|
||||||
|
{**d}
|
||||||
|
|||||||
Reference in New Issue
Block a user