1
0
forked from VimPlug/jedi

Fix classmethod issues

This commit is contained in:
Dave Halter
2018-09-25 00:19:55 +02:00
parent f1b45bed96
commit bdff4e21a8
3 changed files with 106 additions and 32 deletions

View File

@@ -128,11 +128,7 @@ def _parse_argument_clinic(string):
allow_kwargs = True
class AbstractArguments(object):
context = None
argument_node = None
trailer = None
class _AbstractArgumentsMixin(object):
def eval_all(self, funcdef=None):
"""
Evaluates all arguments as a support for static analysis
@@ -142,15 +138,21 @@ class AbstractArguments(object):
types = lazy_context.infer()
try_iter_content(types)
def get_calling_nodes(self):
return []
def unpack(self, funcdef=None):
raise NotImplementedError
def get_executed_params_and_issues(self, execution_context):
return get_executed_params_and_issues(execution_context, self)
def get_calling_nodes(self):
return []
class AbstractArguments(_AbstractArgumentsMixin):
context = None
argument_node = None
trailer = None
class AnonymousArguments(AbstractArguments):
def get_executed_params_and_issues(self, execution_context):
@@ -302,6 +304,28 @@ class ValuesArguments(AbstractArguments):
return '<%s: %s>' % (self.__class__.__name__, self._values_list)
class TreeArgumentsWrapper(_AbstractArgumentsMixin):
def __init__(self, arguments):
self._wrapped_arguments = arguments
@property
def argument_node(self):
return self._wrapped_arguments.argument_node
@property
def trailer(self):
return self._wrapped_arguments.trailer
def unpack(self, func=None):
raise NotImplementedError
def get_calling_nodes(self):
return self._wrapped_arguments.get_calling_nodes()
def __repr__(self):
return '<%s: %s>' % (self.__class__.__name__, self._wrapped_arguments)
def _iterate_star_args(context, array, input_node, funcdef=None):
try:
iter_ = array.py__iter__