1
0
forked from VimPlug/jedi

pep cleanups

This commit is contained in:
Dave Halter
2013-12-24 11:47:28 +01:00
parent 5b33de991b
commit e4013cee77
4 changed files with 11 additions and 16 deletions

View File

@@ -552,7 +552,6 @@ class Script(object):
cur_name_part = name_part
kill_count += 1
context = self._module.get_context()
just_from = next(context) == 'from'
@@ -658,8 +657,6 @@ class Interpreter(Script):
return completions
def defined_names(source, path=None, encoding='utf-8'):
"""
Get all definitions in `source` sorted by its position.

View File

@@ -51,8 +51,7 @@ def follow_param(param):
param_str)
user_position = (2, 0)
p = Parser(param_str, None, user_position,
no_docstr=True)
p = Parser(param_str, None, user_position, no_docstr=True)
if p.user_stmt is None:
return []
return evaluate.follow_statement(p.user_stmt)

View File

@@ -147,9 +147,9 @@ class ParamListener(object):
def search_params(param):
"""
This is a dynamic search for params. If you try to complete a type:
>>> def func(foo):
>>> # here is the completion
>>> foo
... foo
>>> func(1)
>>> func("")
@@ -205,8 +205,7 @@ def search_params(param):
c = [getattr(escope, 'base_func', None) or escope.base
for escope in s
if escope.isinstance(er.Function, er.Class)
]
if escope.isinstance(er.Function, er.Class)]
if compare in c:
# only if we have the correct function we execute
# it, otherwise just ignore it.

View File

@@ -436,8 +436,8 @@ def find_name(scope, name_str, position=None, search_global=False,
if not result and isinstance(nscope, er.Instance):
# __getattr__ / __getattribute__
result += check_getattr(nscope, name_str)
debug.dbg('sfn filter "%s" in (%s-%s): %s@%s' % (name_str, scope,
nscope, u(result), position))
debug.dbg('sfn filter "%s" in (%s-%s): %s@%s'
% (name_str, scope, nscope, u(result), position))
return result
def descriptor_check(result):