mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-16 02:27:06 +08:00
Some small refactorings to the names_dict/deep_ast_copy logic.
This commit is contained in:
@@ -46,9 +46,13 @@ def deep_ast_copy(obj, parent=None, new_elements=None):
|
||||
except AttributeError:
|
||||
pass
|
||||
else:
|
||||
new_obj.names_dict = new_names_dict = {}
|
||||
for string, names in names_dict.items():
|
||||
new_names_dict[string] = [new_elements[n] for n in names]
|
||||
try:
|
||||
new_obj.names_dict = new_names_dict = {}
|
||||
except AttributeError: # Impossible to set CompFor.names_dict
|
||||
pass
|
||||
else:
|
||||
for string, names in names_dict.items():
|
||||
new_names_dict[string] = [new_elements[n] for n in names]
|
||||
return new_obj
|
||||
|
||||
if obj.type == 'name':
|
||||
|
||||
@@ -610,9 +610,7 @@ class FunctionExecution(Executed):
|
||||
return types
|
||||
|
||||
def names_dicts(self, search_global):
|
||||
yield dict((k, [self._copy_dict[v] for v in values])
|
||||
for k, values in self.base.names_dict.items())
|
||||
#yield self.names_dict # Replace with this!
|
||||
yield self.names_dict
|
||||
|
||||
@memoize_default(default=NO_DEFAULT)
|
||||
def _get_params(self):
|
||||
|
||||
@@ -1193,10 +1193,6 @@ class CompFor(BaseNode):
|
||||
arr.append(name)
|
||||
return dct
|
||||
|
||||
@names_dict.setter
|
||||
def names_dict(self, value):
|
||||
pass
|
||||
|
||||
def names_dicts(self, search_global):
|
||||
yield self.names_dict
|
||||
|
||||
|
||||
Reference in New Issue
Block a user