forked from VimPlug/jedi
get_names_dict removed and use instead the names_dict attribute.
This commit is contained in:
@@ -165,10 +165,10 @@ class Instance(use_metaclass(CachedMetaClass, Executed)):
|
||||
# because to follow them and their self variables is too
|
||||
# complicated.
|
||||
sub = self._get_method_execution(sub)
|
||||
print(sub.get_names_dict().values())
|
||||
for per_name_list in sub.get_names_dict().values():
|
||||
print(sub.names_dict.values())
|
||||
for per_name_list in sub.names_dict.values():
|
||||
for call in per_name_list:
|
||||
if unicode(call.name) == self_name \
|
||||
if name.value == self_name \
|
||||
and isinstance(call.next, pr.Call) \
|
||||
and call.next.next is None:
|
||||
names.append(get_instance_el(self._evaluator, self, call.next.name))
|
||||
@@ -591,9 +591,10 @@ class FunctionExecution(Executed):
|
||||
break
|
||||
return types
|
||||
|
||||
@property
|
||||
@underscore_memoization
|
||||
def get_names_dict(self):
|
||||
return LazyDict(self.base.get_names_dict(), self._copy_list)
|
||||
def names_dict(self):
|
||||
return LazyDict(self.base.names_dict, self._copy_list)
|
||||
|
||||
@memoize_default(default=())
|
||||
def _get_params(self):
|
||||
|
||||
@@ -408,15 +408,14 @@ class Scope(Simple, DocstringMixin):
|
||||
:param start_pos: The position (line and column) of the scope.
|
||||
:type start_pos: tuple(int, int)
|
||||
"""
|
||||
__slots__ = ('imports', '_doc_token', 'asserts',
|
||||
'is_generator', '_names_dict')
|
||||
__slots__ = ('imports', '_doc_token', 'asserts', 'names_dict',
|
||||
'is_generator')
|
||||
|
||||
def __init__(self, children):
|
||||
super(Scope, self).__init__(children)
|
||||
self.imports = []
|
||||
self._doc_token = None
|
||||
self.asserts = []
|
||||
self._names_dict = defaultdict(_return_empty_list)
|
||||
self.is_generator = False
|
||||
|
||||
@property
|
||||
@@ -450,13 +449,6 @@ class Scope(Simple, DocstringMixin):
|
||||
def is_scope(self):
|
||||
return True
|
||||
|
||||
def add_name_calls(self, name, calls):
|
||||
"""Add a name to the names_dict."""
|
||||
self._names_dict[name] += calls
|
||||
|
||||
def get_names_dict(self):
|
||||
return self._names_dict
|
||||
|
||||
def add_scope(self, sub, decorators):
|
||||
sub.parent = self.use_as_parent
|
||||
sub.decorators = decorators
|
||||
@@ -661,6 +653,8 @@ class SubModule(Scope, Module):
|
||||
|
||||
|
||||
class ClassOrFunc(Scope):
|
||||
__slots__ = ()
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
return self.children[1]
|
||||
|
||||
Reference in New Issue
Block a user