1
0
forked from VimPlug/jedi

refactor general array lookup method get_index_types

This commit is contained in:
Dave Halter
2014-05-12 15:23:48 +02:00
parent 70d85d1b3a
commit b6ec589997
6 changed files with 28 additions and 19 deletions

View File

@@ -99,7 +99,7 @@ class CompiledObject(Base):
else:
raise KeyError("CompiledObject doesn't have an attribute '%s'." % name)
def get_index_types(self, index_types):
def get_index_types(self, evaluator, index_array):
# If the object doesn't have `__getitem__`, just raise the
# AttributeError.
if not hasattr(self.obj, '__getitem__'):
@@ -110,7 +110,8 @@ class CompiledObject(Base):
return []
result = []
for typ in index_types:
from jedi.evaluate.iterable import create_indexes_or_slices
for typ in create_indexes_or_slices(evaluator, index_array):
index = None
try:
index = typ.obj