1
0
forked from VimPlug/jedi

cleanup - pep8

This commit is contained in:
David Halter
2013-02-05 17:00:17 +01:00
parent 9d60d7b9ea
commit 783ed0b2a0
2 changed files with 9 additions and 5 deletions

View File

@@ -740,7 +740,7 @@ def follow_path(path, scope, call_scope, position=None):
def filter_private_variable(scope, call_scope, var_name):
if isinstance(var_name, (str, unicode)) \
and var_name.startswith('__') and isinstance(scope, er.Instance):
and var_name.startswith('__') and isinstance(scope, er.Instance):
s = call_scope.get_parent_until((pr.Class, er.Instance))
if s != scope and s != scope.base.base:
return True

View File

@@ -248,7 +248,8 @@ class Class(use_metaclass(cache.CachedMetaClass, pr.Base)):
supers.append(cls)
if not supers and self.base.parent != builtin.Builtin.scope:
# add `object` to classes
supers += evaluate.get_scopes_for_name(builtin.Builtin.scope, 'object')
supers += evaluate.get_scopes_for_name(builtin.Builtin.scope,
'object')
return supers
@cache.memoize_default(default=[])
@@ -402,7 +403,8 @@ class Execution(Executable):
for name in names:
key = name.var_args.get_only_subelement()
stmts += evaluate.follow_path(iter([key]), obj, self.base)
stmts += evaluate.follow_path(iter([key]), obj,
self.base)
return stmts
elif func_name == 'type':
# otherwise it would be a metaclass
@@ -757,7 +759,8 @@ class Array(use_metaclass(cache.CachedMetaClass, pr.Base)):
if index_call_list and [x for x in index_call_list if ':' in x]:
return [self]
index_possibilities = list(evaluate.follow_call_list(index_call_list))
index_possibilities = list(evaluate.follow_call_list(
index_call_list))
if len(index_possibilities) == 1:
# This is indexing only one element, with a fixed index number,
# otherwise it just ignores the index (e.g. [1+1]).
@@ -810,7 +813,8 @@ class Array(use_metaclass(cache.CachedMetaClass, pr.Base)):
It returns e.g. for a list: append, pop, ...
"""
# `array.type` is a string with the type, e.g. 'list'.
scope = evaluate.get_scopes_for_name(builtin.Builtin.scope, self._array.type)[0]
scope = evaluate.get_scopes_for_name(builtin.Builtin.scope,
self._array.type)[0]
scope = Instance(scope)
names = scope.get_defined_names()
return [ArrayElement(n) for n in names]