forked from VimPlug/jedi
Remove get_index_and_execute and use something else
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user