forked from VimPlug/jedi
Use unicode literals, to avoid potential issues
This commit is contained in:
@@ -469,7 +469,7 @@ class FakeDict(_FakeArray):
|
|||||||
@register_builtin_method('values')
|
@register_builtin_method('values')
|
||||||
def _values(self):
|
def _values(self):
|
||||||
return ContextSet(FakeSequence(
|
return ContextSet(FakeSequence(
|
||||||
self.evaluator, 'tuple',
|
self.evaluator, u'tuple',
|
||||||
[LazyKnownContexts(self.dict_values())]
|
[LazyKnownContexts(self.dict_values())]
|
||||||
))
|
))
|
||||||
|
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ def get_params(execution_context, var_args):
|
|||||||
var_arg_iterator.push_back((key, argument))
|
var_arg_iterator.push_back((key, argument))
|
||||||
break
|
break
|
||||||
lazy_context_list.append(argument)
|
lazy_context_list.append(argument)
|
||||||
seq = iterable.FakeSequence(execution_context.evaluator, 'tuple', lazy_context_list)
|
seq = iterable.FakeSequence(execution_context.evaluator, u'tuple', lazy_context_list)
|
||||||
result_arg = LazyKnownContext(seq)
|
result_arg = LazyKnownContext(seq)
|
||||||
elif param.star_count == 2:
|
elif param.star_count == 2:
|
||||||
# **kwargs param
|
# **kwargs param
|
||||||
@@ -176,7 +176,7 @@ def _error_argument_count(funcdef, actual_count):
|
|||||||
def _create_default_param(execution_context, param):
|
def _create_default_param(execution_context, param):
|
||||||
if param.star_count == 1:
|
if param.star_count == 1:
|
||||||
result_arg = LazyKnownContext(
|
result_arg = LazyKnownContext(
|
||||||
iterable.FakeSequence(execution_context.evaluator, 'tuple', [])
|
iterable.FakeSequence(execution_context.evaluator, u'tuple', [])
|
||||||
)
|
)
|
||||||
elif param.star_count == 2:
|
elif param.star_count == 2:
|
||||||
result_arg = LazyKnownContext(
|
result_arg = LazyKnownContext(
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ def _evaluate_for_annotation(context, annotation, index=None):
|
|||||||
context_set = context.eval_node(_fix_forward_reference(context, annotation))
|
context_set = context.eval_node(_fix_forward_reference(context, annotation))
|
||||||
if index is not None:
|
if index is not None:
|
||||||
context_set = context_set.filter(
|
context_set = context_set.filter(
|
||||||
lambda context: context.array_type == 'tuple' \
|
lambda context: context.array_type == u'tuple' \
|
||||||
and len(list(context.py__iter__())) >= index
|
and len(list(context.py__iter__())) >= index
|
||||||
).py__getitem__(index)
|
).py__getitem__(index)
|
||||||
return context_set.execute_evaluated()
|
return context_set.execute_evaluated()
|
||||||
@@ -172,7 +172,7 @@ def py__getitem__(context, typ, node):
|
|||||||
from jedi.evaluate.context.iterable import FakeSequence
|
from jedi.evaluate.context.iterable import FakeSequence
|
||||||
args = FakeSequence(
|
args = FakeSequence(
|
||||||
context.evaluator,
|
context.evaluator,
|
||||||
"tuple",
|
u'tuple',
|
||||||
[LazyTreeContext(context, n) for n in nodes]
|
[LazyTreeContext(context, n) for n in nodes]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -209,7 +209,7 @@ def builtins_reversed(evaluator, sequences, obj, arguments):
|
|||||||
# necessary, because `reversed` is a function and autocompletion
|
# necessary, because `reversed` is a function and autocompletion
|
||||||
# would fail in certain cases like `reversed(x).__iter__` if we
|
# would fail in certain cases like `reversed(x).__iter__` if we
|
||||||
# just returned the result directly.
|
# just returned the result directly.
|
||||||
seq = iterable.FakeSequence(evaluator, 'list', rev)
|
seq = iterable.FakeSequence(evaluator, u'list', rev)
|
||||||
arguments = ValuesArguments([ContextSet(seq)])
|
arguments = ValuesArguments([ContextSet(seq)])
|
||||||
return ContextSet(CompiledInstance(evaluator, evaluator.builtins_module, obj, arguments))
|
return ContextSet(CompiledInstance(evaluator, evaluator.builtins_module, obj, arguments))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user