mirror of
https://github.com/davidhalter/jedi.git
synced 2026-10-07 23:14:33 +08:00
Refactor execute_operation a bit
This commit is contained in:
1 parent
bd2ed8dbbd
commit
11a12d6ca8
7 files changed
+36
-17
No files matched your search
@@ -429,12 +429,8 @@ class DictLiteralValue(_DictMixin, SequenceLiteralValue, _DictKeyMixin):
|
||||
compiled_obj_index = compiled.create_simple_object(self.inference_state, index)
|
||||
for key, value in self.get_tree_entries():
|
||||
for k in self._defining_context.infer_node(key):
|
||||
try:
|
||||
method = k.execute_operation
|
||||
except AttributeError:
|
||||
pass
|
||||
else:
|
||||
if method(compiled_obj_index, u'==').get_safe_value():
|
||||
for key_v in k.execute_operation(compiled_obj_index, u'=='):
|
||||
if key_v.get_safe_value():
|
||||
return self._defining_context.infer_node(value)
|
||||
raise SimpleGetItemNotFound('No key found in dictionary %s.' % self)
|
||||
|
||||
|
||||
Reference in new issue
Block a user