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

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()

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()

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.