forked from VimPlug/jedi
Fix all class issues.
This commit is contained in:
@@ -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')
|
||||||
|
|||||||
@@ -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))
|
||||||
|
|||||||
@@ -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,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -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:
|
||||||
|
|||||||
@@ -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!
|
||||||
|
|||||||
Reference in New Issue
Block a user