mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-07 22:44:27 +08:00
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
|
||||
except AttributeError:
|
||||
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)
|
||||
else:
|
||||
context = iterable.SequenceLiteralContext(context.evaluator, context, atom)
|
||||
|
||||
@@ -131,3 +131,11 @@ set_t2 = set()
|
||||
|
||||
#? ['clear', 'copy']
|
||||
set_t2.c
|
||||
|
||||
# -----------------
|
||||
# pep 448 unpacking generalizations
|
||||
# -----------------
|
||||
# python >= 3.5
|
||||
|
||||
#? dict()
|
||||
{**d}
|
||||
|
||||
Reference in New Issue
Block a user