forked from VimPlug/jedi
Try to use a CompiledStubClass to wrap functions inside classes
This commit is contained in:
@@ -4,7 +4,7 @@ from parso.python import tree
|
||||
|
||||
from jedi._compatibility import zip_longest
|
||||
from jedi import debug
|
||||
from jedi.evaluate.utils import to_list, PushBackIterator
|
||||
from jedi.evaluate.utils import PushBackIterator
|
||||
from jedi.evaluate import analysis
|
||||
from jedi.evaluate.lazy_context import LazyKnownContext, LazyKnownContexts, \
|
||||
LazyTreeContext, get_merged_lazy_context
|
||||
|
||||
@@ -303,11 +303,9 @@ class TreeInstance(AbstractInstanceContext):
|
||||
filter = next(self.class_context.get_filters())
|
||||
for init_name in filter.get('__init__'):
|
||||
for init in init_name.infer():
|
||||
if isinstance(init, OverloadedFunctionContext):
|
||||
for func in init.overloaded_functions:
|
||||
yield func
|
||||
elif isinstance(init, FunctionContext):
|
||||
yield init
|
||||
if init.is_function():
|
||||
for signature in init.get_signatures():
|
||||
yield signature.context
|
||||
|
||||
|
||||
class AnonymousInstance(TreeInstance):
|
||||
|
||||
@@ -3,12 +3,12 @@ from abc import abstractproperty
|
||||
|
||||
class AbstractSignature(object):
|
||||
def __init__(self, context, is_bound=False):
|
||||
self._context = context
|
||||
self.context = context
|
||||
self.is_bound = is_bound
|
||||
|
||||
@abstractproperty
|
||||
def name(self):
|
||||
return self._context.name
|
||||
return self.context.name
|
||||
|
||||
def annotation(self):
|
||||
return None
|
||||
@@ -44,7 +44,7 @@ class TreeSignature(AbstractSignature):
|
||||
class BuiltinSignature(AbstractSignature):
|
||||
@property
|
||||
def _function_context(self):
|
||||
return self._context
|
||||
return self.context
|
||||
|
||||
def bind(self):
|
||||
raise NotImplementedError('pls implement, need test case')
|
||||
|
||||
Reference in New Issue
Block a user