1
0
forked from VimPlug/jedi

Replace function call with set literal

This commit is contained in:
Hugo
2018-01-04 16:37:50 +02:00
parent 5755fcb900
commit cc623218e5
13 changed files with 32 additions and 32 deletions
+1 -1
View File
@@ -243,7 +243,7 @@ def _execute_array_values(evaluator, array):
for typ in lazy_context.infer()
)
values.append(LazyKnownContexts(objects))
return set([FakeSequence(evaluator, array.array_type, values)])
return {FakeSequence(evaluator, array.array_type, values)}
else:
return array.execute_evaluated()
+1 -1
View File
@@ -27,7 +27,7 @@ class AbstractNameDefinition(object):
def goto(self):
# Typically names are already definitions and therefore a goto on that
# name will always result on itself.
return set([self])
return {self}
def get_root_context(self):
return self.parent_context.get_root_context()
+2 -2
View File
@@ -286,10 +286,10 @@ def eval_or_test(context, or_test):
# handle lazy evaluation of and/or here.
if operator in ('and', 'or'):
left_bools = set(left.py__bool__() for left in types)
if left_bools == set([True]):
if left_bools == {True}:
if operator == 'and':
types = context.eval_node(right)
elif left_bools == set([False]):
elif left_bools == {False}:
if operator != 'and':
types = context.eval_node(right)
# Otherwise continue, because of uncertainty.
+4 -5
View File
@@ -4,11 +4,10 @@ from inspect import cleandoc
from jedi._compatibility import literal_eval, is_py3
from parso.python import tree
_EXECUTE_NODES = set([
'funcdef', 'classdef', 'import_from', 'import_name', 'test', 'or_test',
'and_test', 'not_test', 'comparison', 'expr', 'xor_expr', 'and_expr',
'shift_expr', 'arith_expr', 'atom_expr', 'term', 'factor', 'power', 'atom'
])
_EXECUTE_NODES = {'funcdef', 'classdef', 'import_from', 'import_name', 'test',
'or_test', 'and_test', 'not_test', 'comparison', 'expr',
'xor_expr', 'and_expr', 'shift_expr', 'arith_expr',
'atom_expr', 'term', 'factor', 'power', 'atom'}
_FLOW_KEYWORDS = (
'try', 'except', 'finally', 'else', 'if', 'elif', 'with', 'for', 'while'