forked from VimPlug/jedi
Fix some small things to make a lot more tests pass
This commit is contained in:
@@ -136,12 +136,12 @@ class Evaluator(object):
|
|||||||
|
|
||||||
def import_module(self, import_names, parent_module_context, sys_path):
|
def import_module(self, import_names, parent_module_context, sys_path):
|
||||||
try:
|
try:
|
||||||
return ContextSet(self.module_cache.get(import_names))
|
return self.module_cache.get(import_names)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
context_set = self._import_module(import_names, parent_module_context, sys_path)
|
context_set = self._import_module(import_names, parent_module_context, sys_path)
|
||||||
self.module_cache.add(context_set, import_names)
|
self.module_cache.add(import_names, context_set)
|
||||||
return context_set
|
return context_set
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ class FunctionContext(use_metaclass(CachedMetaClass, AbstractFunction)):
|
|||||||
|
|
||||||
function = create(tree_node)
|
function = create(tree_node)
|
||||||
|
|
||||||
if len(overloaded_funcs) > 1:
|
if overloaded_funcs:
|
||||||
return OverloadedFunctionContext(
|
return OverloadedFunctionContext(
|
||||||
function,
|
function,
|
||||||
ContextSet.from_iterable(create(f) for f in overloaded_funcs)
|
ContextSet.from_iterable(create(f) for f in overloaded_funcs)
|
||||||
@@ -365,6 +365,9 @@ def _find_overload_functions(context, tree_node):
|
|||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
if tree_node.type == 'lambdef':
|
||||||
|
return
|
||||||
|
|
||||||
if _is_overload_decorated(tree_node):
|
if _is_overload_decorated(tree_node):
|
||||||
yield tree_node
|
yield tree_node
|
||||||
|
|
||||||
@@ -381,4 +384,5 @@ def _find_overload_functions(context, tree_node):
|
|||||||
if funcdef.type == 'funcdef' and _is_overload_decorated(funcdef):
|
if funcdef.type == 'funcdef' and _is_overload_decorated(funcdef):
|
||||||
yield funcdef
|
yield funcdef
|
||||||
|
|
||||||
|
# TODO this is probably not good enough? Why are we always breaking?
|
||||||
break # By default break
|
break # By default break
|
||||||
|
|||||||
@@ -510,7 +510,7 @@ class _AbstractAnnotatedClass(ClassContext):
|
|||||||
|
|
||||||
@to_list
|
@to_list
|
||||||
def py__bases__(self):
|
def py__bases__(self):
|
||||||
for base in super().py__bases__():
|
for base in super(_AbstractAnnotatedClass, self).py__bases__():
|
||||||
yield LazyAnnotatedBaseClass(self, base)
|
yield LazyAnnotatedBaseClass(self, base)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user