forked from VimPlug/jedi
Get lambdas mostly working.
This commit is contained in:
@@ -76,7 +76,7 @@ class Executed(pr.Base):
|
||||
return True
|
||||
|
||||
def get_parent_until(self, *args, **kwargs):
|
||||
return self.base.get_parent_until(*args, **kwargs)
|
||||
return pr.Base.get_parent_until(self, *args, **kwargs)
|
||||
|
||||
@common.safe_property
|
||||
def parent(self):
|
||||
@@ -512,7 +512,7 @@ class Function(use_metaclass(CachedMetaClass, Wrapper)):
|
||||
|
||||
debug.dbg('decorator end %s', f)
|
||||
|
||||
if isinstance(f, pr.Function):
|
||||
if isinstance(f, (pr.Function, pr.Lambda)):
|
||||
return self
|
||||
return f
|
||||
|
||||
@@ -542,6 +542,10 @@ class Function(use_metaclass(CachedMetaClass, Wrapper)):
|
||||
return "<e%s of %s%s>" % (type(self).__name__, self.base_func, dec)
|
||||
|
||||
|
||||
class LambdaWrapper(Function):
|
||||
pass
|
||||
|
||||
|
||||
class LazyDict(object):
|
||||
def __init__(self, old_dct, copy_func):
|
||||
self._copy_func = copy_func
|
||||
@@ -588,6 +592,9 @@ class FunctionExecution(Executed):
|
||||
# inserted params, not in the actual execution of the function.
|
||||
return []
|
||||
|
||||
if isinstance(func, LambdaWrapper):
|
||||
return self._evaluator.eval_element(self.children[-1])
|
||||
|
||||
if check_yields:
|
||||
types = []
|
||||
returns = self.yields
|
||||
|
||||
Reference in New Issue
Block a user