1
0
forked from VimPlug/jedi

Remove get_index_and_execute and use something else

This commit is contained in:
Dave Halter
2019-12-08 22:55:52 +01:00
parent 9e6c53151b
commit 9eef771ec5
2 changed files with 22 additions and 21 deletions
+13 -3
View File
@@ -3,9 +3,10 @@ This module is about generics, like the `int` in `List[int]`. It's not about
the Generic class.
"""
from jedi import debug
from jedi.cache import memoize_method
from jedi.inference.utils import to_tuple
from jedi.inference.base_value import ValueSet
from jedi.inference.base_value import ValueSet, NO_VALUES
from jedi.inference.value.iterable import SequenceLiteralValue
from jedi.inference.helpers import is_string
@@ -22,7 +23,16 @@ def _resolve_forward_references(context, value_set):
yield value
class LazyGenericManager(object):
class _AbstractGenericManager(object):
def get_index_and_execute(self, index):
try:
return self[index].execute_annotation()
except IndexError:
debug.warning('No param #%s found for annotation %s', index, self)
return NO_VALUES
class LazyGenericManager(_AbstractGenericManager):
def __init__(self, context_of_index, index_value):
self._context_of_index = context_of_index
self._index_value = index_value
@@ -65,7 +75,7 @@ class LazyGenericManager(object):
return False
class TupleGenericManager(object):
class TupleGenericManager(_AbstractGenericManager):
def __init__(self, tup):
self._tuple = tup