1
0
forked from VimPlug/jedi

Fix some issues with converting names, see #1466

This commit is contained in:
Dave Halter
2020-01-07 10:59:15 +01:00
parent a17b56f260
commit fdb5071bec
7 changed files with 54 additions and 12 deletions

View File

@@ -133,6 +133,9 @@ class AbstractContext(object):
def py__name__(self):
raise NotImplementedError
def get_value(self):
raise NotImplementedError
@property
def name(self):
return None
@@ -200,6 +203,9 @@ class ValueContext(AbstractContext):
def py__doc__(self):
return self._value.py__doc__()
def get_value(self):
return self._value
def __repr__(self):
return '%s(%s)' % (self.__class__.__name__, self._value)
@@ -226,6 +232,7 @@ class TreeContextMixin(object):
self.inference_state, parent_context.parent_context, class_value)
func = value.BoundMethod(
instance=instance,
class_context=class_value.as_context(),
function=func
)
return func
@@ -365,6 +372,9 @@ class CompForContext(TreeContextMixin, AbstractContext):
def get_filters(self, until_position=None, origin_scope=None):
yield ParserTreeFilter(self)
def get_value(self):
return None
def py__name__(self):
return '<comprehension context>'