forked from VimPlug/jedi
Even more super deletions
This commit is contained in:
@@ -25,7 +25,7 @@ from jedi.parser_utils import function_is_staticmethod, function_is_classmethod
|
||||
|
||||
class InstanceExecutedParamName(ParamName):
|
||||
def __init__(self, instance, function_value, tree_name):
|
||||
super(InstanceExecutedParamName, self).__init__(
|
||||
super().__init__(
|
||||
function_value, tree_name, arguments=None)
|
||||
self._instance = instance
|
||||
|
||||
@@ -38,7 +38,7 @@ class InstanceExecutedParamName(ParamName):
|
||||
|
||||
class AnonymousMethodExecutionFilter(AnonymousFunctionExecutionFilter):
|
||||
def __init__(self, instance, *args, **kwargs):
|
||||
super(AnonymousMethodExecutionFilter, self).__init__(*args, **kwargs)
|
||||
super().__init__(*args, **kwargs)
|
||||
self._instance = instance
|
||||
|
||||
def _convert_param(self, param, name):
|
||||
@@ -55,12 +55,12 @@ class AnonymousMethodExecutionFilter(AnonymousFunctionExecutionFilter):
|
||||
self._function_value,
|
||||
name
|
||||
)
|
||||
return super(AnonymousMethodExecutionFilter, self)._convert_param(param, name)
|
||||
return super()._convert_param(param, name)
|
||||
|
||||
|
||||
class AnonymousMethodExecutionContext(BaseFunctionExecutionContext):
|
||||
def __init__(self, instance, value):
|
||||
super(AnonymousMethodExecutionContext, self).__init__(value)
|
||||
super().__init__(value)
|
||||
self.instance = instance
|
||||
|
||||
def get_filters(self, until_position=None, origin_scope=None):
|
||||
@@ -83,7 +83,7 @@ class AnonymousMethodExecutionContext(BaseFunctionExecutionContext):
|
||||
|
||||
class MethodExecutionContext(FunctionExecutionContext):
|
||||
def __init__(self, instance, *args, **kwargs):
|
||||
super(MethodExecutionContext, self).__init__(*args, **kwargs)
|
||||
super().__init__(*args, **kwargs)
|
||||
self.instance = instance
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ class AbstractInstanceValue(Value):
|
||||
api_type = 'instance'
|
||||
|
||||
def __init__(self, inference_state, parent_context, class_value):
|
||||
super(AbstractInstanceValue, self).__init__(inference_state, parent_context)
|
||||
super().__init__(inference_state, parent_context)
|
||||
# Generated instances are classes that are just generated by self
|
||||
# (No arguments) used.
|
||||
self.class_value = class_value
|
||||
@@ -141,8 +141,7 @@ class CompiledInstance(AbstractInstanceValue):
|
||||
# This is not really a compiled class, it's just an instance from a
|
||||
# compiled class.
|
||||
def __init__(self, inference_state, parent_context, class_value, arguments):
|
||||
super(CompiledInstance, self).__init__(inference_state, parent_context,
|
||||
class_value)
|
||||
super().__init__(inference_state, parent_context, class_value)
|
||||
self._arguments = arguments
|
||||
|
||||
def get_filters(self, origin_scope=None, include_self_names=True):
|
||||
@@ -241,7 +240,7 @@ class _BaseTreeInstance(AbstractInstanceValue):
|
||||
def py__getitem__(self, index_value_set, contextualized_node):
|
||||
names = self.get_function_slot_names('__getitem__')
|
||||
if not names:
|
||||
return super(_BaseTreeInstance, self).py__getitem__(
|
||||
return super().py__getitem__(
|
||||
index_value_set,
|
||||
contextualized_node,
|
||||
)
|
||||
@@ -252,7 +251,7 @@ class _BaseTreeInstance(AbstractInstanceValue):
|
||||
def py__iter__(self, contextualized_node=None):
|
||||
iter_slot_names = self.get_function_slot_names('__iter__')
|
||||
if not iter_slot_names:
|
||||
return super(_BaseTreeInstance, self).py__iter__(contextualized_node)
|
||||
return super().py__iter__(contextualized_node)
|
||||
|
||||
def iterate():
|
||||
for generator in self.execute_function_slots(iter_slot_names):
|
||||
@@ -275,7 +274,7 @@ class _BaseTreeInstance(AbstractInstanceValue):
|
||||
names = self.get_function_slot_names('__call__')
|
||||
if not names:
|
||||
# Means the Instance is not callable.
|
||||
return super(_BaseTreeInstance, self).py__call__(arguments)
|
||||
return super().py__call__(arguments)
|
||||
|
||||
return ValueSet.from_sets(name.infer().execute(arguments) for name in names)
|
||||
|
||||
@@ -319,7 +318,7 @@ class TreeInstance(_BaseTreeInstance):
|
||||
if settings.dynamic_array_additions:
|
||||
arguments = get_dynamic_array_instance(self, arguments)
|
||||
|
||||
super(TreeInstance, self).__init__(inference_state, parent_context, class_value)
|
||||
super().__init__(inference_state, parent_context, class_value)
|
||||
self._arguments = arguments
|
||||
self.tree_node = class_value.tree_node
|
||||
|
||||
@@ -393,7 +392,7 @@ class TreeInstance(_BaseTreeInstance):
|
||||
else:
|
||||
if key == index:
|
||||
return lazy_context.infer()
|
||||
return super(TreeInstance, self).py__simple_getitem__(index)
|
||||
return super().py__simple_getitem__(index)
|
||||
|
||||
def __repr__(self):
|
||||
return "<%s of %s(%s)>" % (self.__class__.__name__, self.class_value,
|
||||
@@ -408,7 +407,7 @@ class CompiledInstanceName(compiled.CompiledName):
|
||||
def __init__(self, inference_state, instance, klass, name):
|
||||
parent_value = klass.parent_context.get_value()
|
||||
assert parent_value is not None, "How? Please reproduce and report"
|
||||
super(CompiledInstanceName, self).__init__(
|
||||
super().__init__(
|
||||
inference_state,
|
||||
parent_value,
|
||||
name.string_name
|
||||
@@ -446,7 +445,7 @@ class CompiledInstanceClassFilter(AbstractFilter):
|
||||
|
||||
class BoundMethod(FunctionMixin, ValueWrapper):
|
||||
def __init__(self, instance, class_context, function):
|
||||
super(BoundMethod, self).__init__(function)
|
||||
super().__init__(function)
|
||||
self.instance = instance
|
||||
self._class_context = class_context
|
||||
|
||||
@@ -457,7 +456,7 @@ class BoundMethod(FunctionMixin, ValueWrapper):
|
||||
def name(self):
|
||||
return FunctionNameInClass(
|
||||
self._class_context,
|
||||
super(BoundMethod, self).name
|
||||
super().name
|
||||
)
|
||||
|
||||
def py__class__(self):
|
||||
@@ -489,7 +488,7 @@ class BoundMethod(FunctionMixin, ValueWrapper):
|
||||
]
|
||||
|
||||
def get_signatures(self):
|
||||
return [sig.bind(self) for sig in super(BoundMethod, self).get_signatures()]
|
||||
return [sig.bind(self) for sig in super().get_signatures()]
|
||||
|
||||
def __repr__(self):
|
||||
return '<%s: %s>' % (self.__class__.__name__, self._wrapped_value)
|
||||
@@ -522,7 +521,7 @@ class SelfName(TreeNameDefinition):
|
||||
|
||||
class LazyInstanceClassName(NameWrapper):
|
||||
def __init__(self, instance, class_member_name):
|
||||
super(LazyInstanceClassName, self).__init__(class_member_name)
|
||||
super().__init__(class_member_name)
|
||||
self._instance = instance
|
||||
|
||||
@iterator_to_value_set
|
||||
@@ -569,7 +568,7 @@ class SelfAttributeFilter(ClassFilter):
|
||||
This class basically filters all the use cases where `self.*` was assigned.
|
||||
"""
|
||||
def __init__(self, instance, instance_class, node_context, origin_scope):
|
||||
super(SelfAttributeFilter, self).__init__(
|
||||
super().__init__(
|
||||
class_value=instance_class,
|
||||
node_context=node_context,
|
||||
origin_scope=origin_scope,
|
||||
@@ -613,7 +612,7 @@ class SelfAttributeFilter(ClassFilter):
|
||||
|
||||
class InstanceArguments(TreeArgumentsWrapper):
|
||||
def __init__(self, instance, arguments):
|
||||
super(InstanceArguments, self).__init__(arguments)
|
||||
super().__init__(arguments)
|
||||
self.instance = instance
|
||||
|
||||
def unpack(self, func=None):
|
||||
|
||||
Reference in New Issue
Block a user