1
0
forked from VimPlug/jedi

Fix all class issues.

This commit is contained in:
Dave Halter
2016-11-10 23:43:07 +01:00
parent cfc988b786
commit 14a8377817
5 changed files with 8 additions and 5 deletions

View File

@@ -71,6 +71,7 @@ def search_params(evaluator, parent_context, funcdef):
if not settings.dynamic_params: if not settings.dynamic_params:
return set() return set()
raise NotImplementedError
evaluator.dynamic_params_depth += 1 evaluator.dynamic_params_depth += 1
try: try:
debug.dbg('Dynamic param search in %s.', funcdef.name.value, color='MAGENTA') debug.dbg('Dynamic param search in %s.', funcdef.name.value, color='MAGENTA')

View File

@@ -80,7 +80,7 @@ class AnonymousInstanceParamName(ParamName):
if self.tree_name.parent.position_nr == 0: if self.tree_name.parent.position_nr == 0:
# This is a speed optimization, to return the self param (because # This is a speed optimization, to return the self param (because
# it's known). This only affects anonymous instances. # it's known). This only affects anonymous instances.
return set([self.parent_context]) return set([self.parent_context.instance])
else: else:
return self._get_param().infer() return self._get_param().infer()
@@ -137,7 +137,7 @@ class ParserTreeFilter(AbstractUsedNamesFilter):
def _filter(self, names): def _filter(self, names):
names = super(ParserTreeFilter, self)._filter(names) names = super(ParserTreeFilter, self)._filter(names)
names = [n for n in names if n.is_definition()] names = [n for n in names if n.is_definition() and n.parent.type != 'trailer']
names = [n for n in names if n.parent.get_parent_scope() == self._parser_scope] names = [n for n in names if n.parent.get_parent_scope() == self._parser_scope]
return list(self._check_flows(names)) return list(self._check_flows(names))

View File

@@ -172,8 +172,8 @@ class TreeInstance(AbstractInstanceContext):
self.var_args self.var_args
) )
else: else:
return er.AnonymousFunctionExecution( return AnonymousInstanceFunctionExecution(
self.evaluator, self,
class_context.parent_context, class_context.parent_context,
scope, scope,
) )

View File

@@ -118,7 +118,7 @@ class TreeArguments(AbstractArguments):
for values in list(zip_longest(*iterators)): for values in list(zip_longest(*iterators)):
# TODO zip_longest yields None, that means this would raise # TODO zip_longest yields None, that means this would raise
# an exception? # an exception?
yield None, context.get_merged_lazycontext(values) yield None, context.get_merged_lazy_context(values)
elif stars == 2: elif stars == 2:
arrays = self._evaluator.eval_element(self.context, el) arrays = self._evaluator.eval_element(self.context, el)
for dct in arrays: for dct in arrays:

View File

@@ -50,6 +50,8 @@ class TestClass(object):
self.var_local = 3 self.var_local = 3
#? ['var_class', 'var_func', 'var_inst', 'var_local'] #? ['var_class', 'var_func', 'var_inst', 'var_local']
self.var_ self.var_
#?
var_local
def ret(self, a1): def ret(self, a1):
# should not know any class functions! # should not know any class functions!