forked from VimPlug/jedi
infer_state -> inference_state
This commit is contained in:
@@ -10,7 +10,7 @@ from jedi.inference.names import ValueName, TreeNameDefinition
|
||||
from jedi.inference.base_value import Value, NO_VALUES, ValueSet, \
|
||||
iterator_to_value_set, ValueWrapper
|
||||
from jedi.inference.lazy_value import LazyKnownValue, LazyKnownValues
|
||||
from jedi.inference.cache import infer_state_method_cache
|
||||
from jedi.inference.cache import inference_state_method_cache
|
||||
from jedi.inference.arguments import AnonymousArguments, \
|
||||
ValuesArguments, TreeArgumentsWrapper
|
||||
from jedi.inference.value.function import \
|
||||
@@ -50,7 +50,7 @@ class AnonymousInstanceArguments(AnonymousArguments):
|
||||
# executions of this function, we have all the params already.
|
||||
return [self_param], []
|
||||
executed_params = list(search_params(
|
||||
execution_value.infer_state,
|
||||
execution_value.inference_state,
|
||||
execution_value,
|
||||
execution_value.tree_node
|
||||
))
|
||||
@@ -61,8 +61,8 @@ class AnonymousInstanceArguments(AnonymousArguments):
|
||||
class AbstractInstanceValue(Value):
|
||||
api_type = u'instance'
|
||||
|
||||
def __init__(self, infer_state, parent_context, class_value, var_args):
|
||||
super(AbstractInstanceValue, self).__init__(infer_state, parent_context)
|
||||
def __init__(self, inference_state, parent_context, class_value, var_args):
|
||||
super(AbstractInstanceValue, self).__init__(inference_state, parent_context)
|
||||
# Generated instances are classes that are just generated by self
|
||||
# (No var_args) used.
|
||||
self.class_value = class_value
|
||||
@@ -117,7 +117,7 @@ class AbstractInstanceValue(Value):
|
||||
names = self.get_function_slot_names(u'__get__')
|
||||
if names:
|
||||
if obj is None:
|
||||
obj = compiled.builtin_from_name(self.infer_state, u'None')
|
||||
obj = compiled.builtin_from_name(self.inference_state, u'None')
|
||||
return self.execute_function_slots(names, obj, class_value)
|
||||
else:
|
||||
return ValueSet([self])
|
||||
@@ -168,7 +168,7 @@ class AbstractInstanceValue(Value):
|
||||
for generator in self.execute_function_slots(iter_slot_names):
|
||||
if generator.is_instance() and not generator.is_compiled():
|
||||
# `__next__` logic.
|
||||
if self.infer_state.environment.version_info.major == 2:
|
||||
if self.inference_state.environment.version_info.major == 2:
|
||||
name = u'next'
|
||||
else:
|
||||
name = u'__next__'
|
||||
@@ -199,7 +199,7 @@ class AbstractInstanceValue(Value):
|
||||
bound_method = BoundMethod(self, function)
|
||||
yield bound_method.get_function_execution(self.var_args)
|
||||
|
||||
@infer_state_method_cache()
|
||||
@inference_state_method_cache()
|
||||
def create_instance_value(self, class_value, node):
|
||||
if node.parent.type in ('funcdef', 'classdef'):
|
||||
node = node.parent
|
||||
@@ -219,7 +219,7 @@ class AbstractInstanceValue(Value):
|
||||
else:
|
||||
return bound_method.get_function_execution()
|
||||
elif scope.type == 'classdef':
|
||||
class_value = ClassValue(self.infer_state, parent_context, scope)
|
||||
class_value = ClassValue(self.inference_state, parent_context, scope)
|
||||
return class_value
|
||||
elif scope.type in ('comp_for', 'sync_comp_for'):
|
||||
# Comprehensions currently don't have a special scope in Jedi.
|
||||
@@ -238,9 +238,9 @@ class AbstractInstanceValue(Value):
|
||||
|
||||
|
||||
class CompiledInstance(AbstractInstanceValue):
|
||||
def __init__(self, infer_state, parent_context, class_value, var_args):
|
||||
def __init__(self, inference_state, parent_context, class_value, var_args):
|
||||
self._original_var_args = var_args
|
||||
super(CompiledInstance, self).__init__(infer_state, parent_context, class_value, var_args)
|
||||
super(CompiledInstance, self).__init__(inference_state, parent_context, class_value, var_args)
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
@@ -258,16 +258,16 @@ class CompiledInstance(AbstractInstanceValue):
|
||||
|
||||
|
||||
class TreeInstance(AbstractInstanceValue):
|
||||
def __init__(self, infer_state, parent_context, class_value, var_args):
|
||||
def __init__(self, inference_state, parent_context, class_value, var_args):
|
||||
# I don't think that dynamic append lookups should happen here. That
|
||||
# sounds more like something that should go to py__iter__.
|
||||
if class_value.py__name__() in ['list', 'set'] \
|
||||
and parent_context.get_root_value() == infer_state.builtins_module:
|
||||
and parent_context.get_root_value() == inference_state.builtins_module:
|
||||
# compare the module path with the builtin name.
|
||||
if settings.dynamic_array_additions:
|
||||
var_args = iterable.get_dynamic_array_instance(self, var_args)
|
||||
|
||||
super(TreeInstance, self).__init__(infer_state, parent_context,
|
||||
super(TreeInstance, self).__init__(inference_state, parent_context,
|
||||
class_value, var_args)
|
||||
self.tree_node = class_value.tree_node
|
||||
|
||||
@@ -277,7 +277,7 @@ class TreeInstance(AbstractInstanceValue):
|
||||
|
||||
# This can recurse, if the initialization of the class includes a reference
|
||||
# to itself.
|
||||
@infer_state_method_cache(default=None)
|
||||
@inference_state_method_cache(default=None)
|
||||
def _get_annotated_class_object(self):
|
||||
from jedi.inference.gradual.annotation import py__annotations__, \
|
||||
infer_type_vars_for_execution
|
||||
@@ -313,9 +313,9 @@ class TreeInstance(AbstractInstanceValue):
|
||||
|
||||
|
||||
class AnonymousInstance(TreeInstance):
|
||||
def __init__(self, infer_state, parent_context, class_value):
|
||||
def __init__(self, inference_state, parent_context, class_value):
|
||||
super(AnonymousInstance, self).__init__(
|
||||
infer_state,
|
||||
inference_state,
|
||||
parent_context,
|
||||
class_value,
|
||||
var_args=AnonymousInstanceArguments(self),
|
||||
@@ -327,9 +327,9 @@ class AnonymousInstance(TreeInstance):
|
||||
|
||||
class CompiledInstanceName(compiled.CompiledName):
|
||||
|
||||
def __init__(self, infer_state, instance, klass, name):
|
||||
def __init__(self, inference_state, instance, klass, name):
|
||||
super(CompiledInstanceName, self).__init__(
|
||||
infer_state,
|
||||
inference_state,
|
||||
klass.parent_context,
|
||||
name.string_name
|
||||
)
|
||||
@@ -361,7 +361,7 @@ class CompiledInstanceClassFilter(AbstractFilter):
|
||||
def _convert(self, names):
|
||||
klass = self._class_filter.compiled_object
|
||||
return [
|
||||
CompiledInstanceName(self._instance.infer_state, self._instance, klass, n)
|
||||
CompiledInstanceName(self._instance.inference_state, self._instance, klass, n)
|
||||
for n in names
|
||||
]
|
||||
|
||||
@@ -375,7 +375,7 @@ class BoundMethod(FunctionMixin, ValueWrapper):
|
||||
return True
|
||||
|
||||
def py__class__(self):
|
||||
c, = values_from_qualified_names(self.infer_state, u'types', u'MethodType')
|
||||
c, = values_from_qualified_names(self.inference_state, u'types', u'MethodType')
|
||||
return c
|
||||
|
||||
def _get_arguments(self, arguments):
|
||||
|
||||
Reference in New Issue
Block a user