Remove super arguments

This commit is contained in:
Dave Halter
2020-07-02 10:59:59 +02:00
parent 216ce8726c
commit a0de93a638
19 changed files with 67 additions and 68 deletions

View File

@@ -797,7 +797,7 @@ class Interpreter(Script):
if not isinstance(environment, InterpreterEnvironment): if not isinstance(environment, InterpreterEnvironment):
raise TypeError("The environment needs to be an InterpreterEnvironment subclass.") raise TypeError("The environment needs to be an InterpreterEnvironment subclass.")
super(Interpreter, self).__init__(code, environment=environment, super().__init__(code, environment=environment,
project=Project(os.getcwd()), **kwds) project=Project(os.getcwd()), **kwds)
self.namespaces = namespaces self.namespaces = namespaces
self._inference_state.allow_descriptor_getattr = self._allow_descriptor_getattr_default self._inference_state.allow_descriptor_getattr = self._allow_descriptor_getattr_default

View File

@@ -635,7 +635,7 @@ class Completion(BaseName):
""" """
def __init__(self, inference_state, name, stack, like_name_length, def __init__(self, inference_state, name, stack, like_name_length,
is_fuzzy, cached_name=None): is_fuzzy, cached_name=None):
super(Completion, self).__init__(inference_state, name) super().__init__(inference_state, name)
self._like_name_length = like_name_length self._like_name_length = like_name_length
self._stack = stack self._stack = stack
@@ -706,7 +706,7 @@ class Completion(BaseName):
# wouldn't load like > 100 Python modules anymore. # wouldn't load like > 100 Python modules anymore.
fast = False fast = False
return super(Completion, self).docstring(raw=raw, fast=fast) return super().docstring(raw=raw, fast=fast)
def _get_docstring(self): def _get_docstring(self):
if self._cached_name is not None: if self._cached_name is not None:
@@ -715,7 +715,7 @@ class Completion(BaseName):
self._name.get_public_name(), self._name.get_public_name(),
lambda: self._get_cache() lambda: self._get_cache()
) )
return super(Completion, self)._get_docstring() return super()._get_docstring()
def _get_docstring_signature(self): def _get_docstring_signature(self):
if self._cached_name is not None: if self._cached_name is not None:
@@ -724,13 +724,13 @@ class Completion(BaseName):
self._name.get_public_name(), self._name.get_public_name(),
lambda: self._get_cache() lambda: self._get_cache()
) )
return super(Completion, self)._get_docstring_signature() return super()._get_docstring_signature()
def _get_cache(self): def _get_cache(self):
return ( return (
super(Completion, self).type, super().type,
super(Completion, self)._get_docstring_signature(), super()._get_docstring_signature(),
super(Completion, self)._get_docstring(), super()._get_docstring(),
) )
@property @property
@@ -746,7 +746,7 @@ class Completion(BaseName):
lambda: self._get_cache() lambda: self._get_cache()
) )
return super(Completion, self).type return super().type
def __repr__(self): def __repr__(self):
return '<%s: %s>' % (type(self).__name__, self._name.get_public_name()) return '<%s: %s>' % (type(self).__name__, self._name.get_public_name())
@@ -758,7 +758,7 @@ class Name(BaseName):
:meth:`.Script.goto` or :meth:`.Script.infer`. :meth:`.Script.goto` or :meth:`.Script.infer`.
""" """
def __init__(self, inference_state, definition): def __init__(self, inference_state, definition):
super(Name, self).__init__(inference_state, definition) super().__init__(inference_state, definition)
@property @property
def desc_with_module(self): def desc_with_module(self):
@@ -811,7 +811,7 @@ class BaseSignature(Name):
calls. calls.
""" """
def __init__(self, inference_state, signature): def __init__(self, inference_state, signature):
super(BaseSignature, self).__init__(inference_state, signature.name) super().__init__(inference_state, signature.name)
self._signature = signature self._signature = signature
@property @property
@@ -841,7 +841,7 @@ class Signature(BaseSignature):
:meth:`.Script.get_signatures`. :meth:`.Script.get_signatures`.
""" """
def __init__(self, inference_state, signature, call_details): def __init__(self, inference_state, signature, call_details):
super(Signature, self).__init__(inference_state, signature) super().__init__(inference_state, signature)
self._call_details = call_details self._call_details = call_details
self._signature = signature self._signature = signature

View File

@@ -21,7 +21,7 @@ class NamespaceObject(object):
class MixedModuleContext(ModuleContext): class MixedModuleContext(ModuleContext):
def __init__(self, tree_module_value, namespaces): def __init__(self, tree_module_value, namespaces):
super(MixedModuleContext, self).__init__(tree_module_value) super().__init__(tree_module_value)
self._namespace_objects = [NamespaceObject(n) for n in namespaces] self._namespace_objects = [NamespaceObject(n) for n in namespaces]
def _get_mixed_object(self, compiled_value): def _get_mixed_object(self, compiled_value):

View File

@@ -65,7 +65,7 @@ class FileIOFolderMixin(object):
class ZipFileIO(file_io.KnownContentFileIO, FileIOFolderMixin): class ZipFileIO(file_io.KnownContentFileIO, FileIOFolderMixin):
"""For .zip and .egg archives""" """For .zip and .egg archives"""
def __init__(self, path, code, zip_path): def __init__(self, path, code, zip_path):
super(ZipFileIO, self).__init__(path, code) super().__init__(path, code)
self._zip_path = zip_path self._zip_path = zip_path
def get_last_modified(self): def get_last_modified(self):

View File

@@ -355,7 +355,7 @@ class ValueWrapper(_ValueWrapperBase):
class TreeValue(Value): class TreeValue(Value):
def __init__(self, inference_state, parent_context, tree_node): def __init__(self, inference_state, parent_context, tree_node):
super(TreeValue, self).__init__(inference_state, parent_context) super().__init__(inference_state, parent_context)
self.tree_node = tree_node self.tree_node = tree_node
def __repr__(self): def __repr__(self):

View File

@@ -78,7 +78,7 @@ class CachedMetaClass(type):
""" """
@inference_state_as_method_param_cache() @inference_state_as_method_param_cache()
def __call__(self, *args, **kwargs): def __call__(self, *args, **kwargs):
return super(CachedMetaClass, self).__call__(*args, **kwargs) return super().__call__(*args, **kwargs)
def inference_state_method_generator_cache(): def inference_state_method_generator_cache():

View File

@@ -28,7 +28,7 @@ class ExactValue(LazyValueWrapper):
if name in ('get_safe_value', 'execute_operation', 'access_handle', if name in ('get_safe_value', 'execute_operation', 'access_handle',
'negate', 'py__bool__', 'is_compiled'): 'negate', 'py__bool__', 'is_compiled'):
return getattr(self._compiled_value, name) return getattr(self._compiled_value, name)
return super(ExactValue, self).__getattribute__(name) return super().__getattribute__(name)
def _get_wrapped_value(self): def _get_wrapped_value(self):
instance, = builtin_from_name( instance, = builtin_from_name(

View File

@@ -4,7 +4,6 @@ Used only for REPL Completion.
import inspect import inspect
import os import os
import sys
from jedi.parser_utils import get_cached_code_lines from jedi.parser_utils import get_cached_code_lines
@@ -43,7 +42,7 @@ class MixedObject(ValueWrapper):
to modify the runtime. to modify the runtime.
""" """
def __init__(self, compiled_value, tree_value): def __init__(self, compiled_value, tree_value):
super(MixedObject, self).__init__(tree_value) super().__init__(tree_value)
self.compiled_value = compiled_value self.compiled_value = compiled_value
self.access_handle = compiled_value.access_handle self.access_handle = compiled_value.access_handle
@@ -104,7 +103,7 @@ class MixedName(NameWrapper):
The ``CompiledName._compiled_value`` is our MixedObject. The ``CompiledName._compiled_value`` is our MixedObject.
""" """
def __init__(self, wrapped_name, parent_tree_value): def __init__(self, wrapped_name, parent_tree_value):
super(MixedName, self).__init__(wrapped_name) super().__init__(wrapped_name)
self._parent_tree_value = parent_tree_value self._parent_tree_value = parent_tree_value
@property @property
@@ -130,12 +129,12 @@ class MixedName(NameWrapper):
class MixedObjectFilter(compiled.CompiledValueFilter): class MixedObjectFilter(compiled.CompiledValueFilter):
def __init__(self, inference_state, compiled_value, tree_value): def __init__(self, inference_state, compiled_value, tree_value):
super(MixedObjectFilter, self).__init__(inference_state, compiled_value) super().__init__(inference_state, compiled_value)
self._tree_value = tree_value self._tree_value = tree_value
def _create_name(self, name): def _create_name(self, name):
return MixedName( return MixedName(
super(MixedObjectFilter, self)._create_name(name), super()._create_name(name),
self._tree_value, self._tree_value,
) )

View File

@@ -118,7 +118,7 @@ class InferenceStateSameProcess(_InferenceStateProcess):
class InferenceStateSubprocess(_InferenceStateProcess): class InferenceStateSubprocess(_InferenceStateProcess):
def __init__(self, inference_state, compiled_subprocess): def __init__(self, inference_state, compiled_subprocess):
super(InferenceStateSubprocess, self).__init__(inference_state) super().__init__(inference_state)
self._used = False self._used = False
self._compiled_subprocess = compiled_subprocess self._compiled_subprocess = compiled_subprocess

View File

@@ -44,7 +44,7 @@ class CheckAttribute(object):
class CompiledValue(Value): class CompiledValue(Value):
def __init__(self, inference_state, access_handle, parent_context=None): def __init__(self, inference_state, access_handle, parent_context=None):
super(CompiledValue, self).__init__(inference_state, parent_context) super().__init__(inference_state, parent_context)
self.access_handle = access_handle self.access_handle = access_handle
def py__call__(self, arguments): def py__call__(self, arguments):
@@ -59,7 +59,7 @@ class CompiledValue(Value):
try: try:
self.access_handle.getattr_paths('__call__') self.access_handle.getattr_paths('__call__')
except AttributeError: except AttributeError:
return super(CompiledValue, self).py__call__(arguments) return super().py__call__(arguments)
else: else:
if self.access_handle.is_class(): if self.access_handle.is_class():
from jedi.inference.value import CompiledInstance from jedi.inference.value import CompiledInstance
@@ -164,7 +164,7 @@ class CompiledValue(Value):
try: try:
access = self.access_handle.py__simple_getitem__(index) access = self.access_handle.py__simple_getitem__(index)
except AttributeError: except AttributeError:
return super(CompiledValue, self).py__simple_getitem__(index) return super().py__simple_getitem__(index)
if access is None: if access is None:
return NO_VALUES return NO_VALUES
@@ -175,7 +175,7 @@ class CompiledValue(Value):
if all_access_paths is None: if all_access_paths is None:
# This means basically that no __getitem__ has been defined on this # This means basically that no __getitem__ has been defined on this
# object. # object.
return super(CompiledValue, self).py__getitem__(index_value_set, contextualized_node) return super().py__getitem__(index_value_set, contextualized_node)
return ValueSet( return ValueSet(
create_from_access_path(self.inference_state, access) create_from_access_path(self.inference_state, access)
for access in all_access_paths for access in all_access_paths
@@ -187,7 +187,7 @@ class CompiledValue(Value):
# just start with __getitem__(0). This is especially true for # just start with __getitem__(0). This is especially true for
# Python 2 strings, where `str.__iter__` is not even defined. # Python 2 strings, where `str.__iter__` is not even defined.
if not self.access_handle.has_iter(): if not self.access_handle.has_iter():
for x in super(CompiledValue, self).py__iter__(contextualized_node): for x in super().py__iter__(contextualized_node):
yield x yield x
access_path_list = self.access_handle.py__iter__list() access_path_list = self.access_handle.py__iter__list()
@@ -265,7 +265,7 @@ class CompiledValue(Value):
v.with_generics(arguments) v.with_generics(arguments)
for v in self.inference_state.typing_module.py__getattribute__(name) for v in self.inference_state.typing_module.py__getattribute__(name)
]).execute_annotation() ]).execute_annotation()
return super(CompiledValue, self).execute_annotation() return super().execute_annotation()
def negate(self): def negate(self):
return create_from_access_path(self.inference_state, self.access_handle.negate()) return create_from_access_path(self.inference_state, self.access_handle.negate())

View File

@@ -164,7 +164,7 @@ class ValueContext(AbstractContext):
Should be defined, otherwise the API returns empty types. Should be defined, otherwise the API returns empty types.
""" """
def __init__(self, value): def __init__(self, value):
super(ValueContext, self).__init__(value.inference_state) super().__init__(value.inference_state)
self._value = value self._value = value
@property @property
@@ -374,7 +374,7 @@ class ClassContext(TreeContextMixin, ValueContext):
class CompForContext(TreeContextMixin, AbstractContext): class CompForContext(TreeContextMixin, AbstractContext):
def __init__(self, parent_context, comp_for): def __init__(self, parent_context, comp_for):
super(CompForContext, self).__init__(parent_context.inference_state) super().__init__(parent_context.inference_state)
self.tree_node = comp_for self.tree_node = comp_for
self.parent_context = parent_context self.parent_context = parent_context

View File

@@ -108,13 +108,13 @@ class ParserTreeFilter(AbstractUsedNamesFilter):
""" """
if node_context is None: if node_context is None:
node_context = parent_context node_context = parent_context
super(ParserTreeFilter, self).__init__(parent_context, node_context.tree_node) super().__init__(parent_context, node_context.tree_node)
self._node_context = node_context self._node_context = node_context
self._origin_scope = origin_scope self._origin_scope = origin_scope
self._until_position = until_position self._until_position = until_position
def _filter(self, names): def _filter(self, names):
names = super(ParserTreeFilter, self)._filter(names) names = super()._filter(names)
names = [n for n in names if self._is_name_reachable(n)] names = [n for n in names if self._is_name_reachable(n)]
return list(self._check_flows(names)) return list(self._check_flows(names))
@@ -142,7 +142,7 @@ class ParserTreeFilter(AbstractUsedNamesFilter):
class _FunctionExecutionFilter(ParserTreeFilter): class _FunctionExecutionFilter(ParserTreeFilter):
def __init__(self, parent_context, function_value, until_position, origin_scope): def __init__(self, parent_context, function_value, until_position, origin_scope):
super(_FunctionExecutionFilter, self).__init__( super().__init__(
parent_context, parent_context,
until_position=until_position, until_position=until_position,
origin_scope=origin_scope, origin_scope=origin_scope,
@@ -167,7 +167,7 @@ class _FunctionExecutionFilter(ParserTreeFilter):
class FunctionExecutionFilter(_FunctionExecutionFilter): class FunctionExecutionFilter(_FunctionExecutionFilter):
def __init__(self, *args, arguments, **kwargs): def __init__(self, *args, arguments, **kwargs):
super(FunctionExecutionFilter, self).__init__(*args, **kwargs) super().__init__(*args, **kwargs)
self._arguments = arguments self._arguments = arguments
def _convert_param(self, param, name): def _convert_param(self, param, name):
@@ -248,7 +248,7 @@ class _BuiltinMappedMethod(ValueWrapper):
api_type = 'function' api_type = 'function'
def __init__(self, value, method, builtin_func): def __init__(self, value, method, builtin_func):
super(_BuiltinMappedMethod, self).__init__(builtin_func) super().__init__(builtin_func)
self._value = value self._value = value
self._method = method self._method = method
@@ -287,7 +287,7 @@ class SpecialMethodFilter(DictFilter):
]) ])
def __init__(self, value, dct, builtin_value): def __init__(self, value, dct, builtin_value):
super(SpecialMethodFilter, self).__init__(dct) super().__init__(dct)
self.value = value self.value = value
self._builtin_value = builtin_value self._builtin_value = builtin_value
""" """
@@ -303,7 +303,7 @@ class SpecialMethodFilter(DictFilter):
class _OverwriteMeta(type): class _OverwriteMeta(type):
def __init__(cls, name, bases, dct): def __init__(cls, name, bases, dct):
super(_OverwriteMeta, cls).__init__(name, bases, dct) super().__init__(name, bases, dct)
base_dct = {} base_dct = {}
for base_cls in reversed(cls.__bases__): for base_cls in reversed(cls.__bases__):

View File

@@ -70,7 +70,7 @@ class _TypeVarFilter(object):
class _AnnotatedClassContext(ClassContext): class _AnnotatedClassContext(ClassContext):
def get_filters(self, *args, **kwargs): def get_filters(self, *args, **kwargs):
filters = super(_AnnotatedClassContext, self).get_filters( filters = super().get_filters(
*args, **kwargs *args, **kwargs
) )
for f in filters: for f in filters:
@@ -164,7 +164,7 @@ class GenericClass(DefineGenericBaseClass, ClassMixin):
my_foo_int_cls = Foo[int] my_foo_int_cls = Foo[int]
""" """
def __init__(self, class_value, generics_manager): def __init__(self, class_value, generics_manager):
super(GenericClass, self).__init__(generics_manager) super().__init__(generics_manager)
self._class_value = class_value self._class_value = class_value
def _get_wrapped_value(self): def _get_wrapped_value(self):
@@ -186,7 +186,7 @@ class GenericClass(DefineGenericBaseClass, ClassMixin):
return _TypeVarFilter(self.get_generics(), self.list_type_vars()) return _TypeVarFilter(self.get_generics(), self.list_type_vars())
def py__call__(self, arguments): def py__call__(self, arguments):
instance, = super(GenericClass, self).py__call__(arguments) instance, = super().py__call__(arguments)
return ValueSet([_GenericInstanceWrapper(instance)]) return ValueSet([_GenericInstanceWrapper(instance)])
def _as_context(self): def _as_context(self):
@@ -201,7 +201,7 @@ class GenericClass(DefineGenericBaseClass, ClassMixin):
return GenericClass(self._class_value, generics_manager) return GenericClass(self._class_value, generics_manager)
def is_sub_class_of(self, class_value): def is_sub_class_of(self, class_value):
if super(GenericClass, self).is_sub_class_of(class_value): if super().is_sub_class_of(class_value):
return True return True
return self._class_value.is_sub_class_of(class_value) return self._class_value.is_sub_class_of(class_value)
@@ -329,7 +329,7 @@ class _PseudoTreeNameClass(Value):
api_type = 'class' api_type = 'class'
def __init__(self, parent_context, tree_name): def __init__(self, parent_context, tree_name):
super(_PseudoTreeNameClass, self).__init__( super().__init__(
parent_context.inference_state, parent_context.inference_state,
parent_context parent_context
) )
@@ -388,7 +388,7 @@ class BaseTypingValue(LazyValueWrapper):
class BaseTypingClassWithGenerics(DefineGenericBaseClass): class BaseTypingClassWithGenerics(DefineGenericBaseClass):
def __init__(self, parent_context, tree_name, generics_manager): def __init__(self, parent_context, tree_name, generics_manager):
super(BaseTypingClassWithGenerics, self).__init__(generics_manager) super().__init__(generics_manager)
self.inference_state = parent_context.inference_state self.inference_state = parent_context.inference_state
self.parent_context = parent_context self.parent_context = parent_context
self._tree_name = tree_name self._tree_name = tree_name

View File

@@ -10,7 +10,7 @@ class StubModuleValue(ModuleValue):
_module_name_class = StubModuleName _module_name_class = StubModuleName
def __init__(self, non_stub_value_set, *args, **kwargs): def __init__(self, non_stub_value_set, *args, **kwargs):
super(StubModuleValue, self).__init__(*args, **kwargs) super().__init__(*args, **kwargs)
self.non_stub_value_set = non_stub_value_set self.non_stub_value_set = non_stub_value_set
def is_stub(self): def is_stub(self):
@@ -30,7 +30,7 @@ class StubModuleValue(ModuleValue):
pass pass
else: else:
names.update(method()) names.update(method())
names.update(super(StubModuleValue, self).sub_modules_dict()) names.update(super().sub_modules_dict())
return names return names
def _get_stub_filters(self, origin_scope): def _get_stub_filters(self, origin_scope):
@@ -40,7 +40,7 @@ class StubModuleValue(ModuleValue):
)] + list(self.iter_star_filters()) )] + list(self.iter_star_filters())
def get_filters(self, origin_scope=None): def get_filters(self, origin_scope=None):
filters = super(StubModuleValue, self).get_filters(origin_scope) filters = super().get_filters(origin_scope)
next(filters, None) # Ignore the first filter and replace it with our own next(filters, None) # Ignore the first filter and replace it with our own
stub_filters = self._get_stub_filters(origin_scope=origin_scope) stub_filters = self._get_stub_filters(origin_scope=origin_scope)
for f in stub_filters: for f in stub_filters:
@@ -57,12 +57,12 @@ class StubModuleContext(ModuleContext):
def get_filters(self, until_position=None, origin_scope=None): def get_filters(self, until_position=None, origin_scope=None):
# Make sure to ignore the position, because positions are not relevant # Make sure to ignore the position, because positions are not relevant
# for stubs. # for stubs.
return super(StubModuleContext, self).get_filters(origin_scope=origin_scope) return super().get_filters(origin_scope=origin_scope)
class TypingModuleWrapper(StubModuleValue): class TypingModuleWrapper(StubModuleValue):
def get_filters(self, *args, **kwargs): def get_filters(self, *args, **kwargs):
filters = super(TypingModuleWrapper, self).get_filters(*args, **kwargs) filters = super().get_filters(*args, **kwargs)
f = next(filters, None) f = next(filters, None)
assert f is not None assert f is not None
yield TypingModuleFilterWrapper(f) yield TypingModuleFilterWrapper(f)
@@ -75,7 +75,7 @@ class TypingModuleWrapper(StubModuleValue):
class TypingModuleContext(ModuleContext): class TypingModuleContext(ModuleContext):
def get_filters(self, *args, **kwargs): def get_filters(self, *args, **kwargs):
filters = super(TypingModuleContext, self).get_filters(*args, **kwargs) filters = super().get_filters(*args, **kwargs)
yield TypingModuleFilterWrapper(next(filters, None)) yield TypingModuleFilterWrapper(next(filters, None))
for f in filters: for f in filters:
yield f yield f
@@ -85,7 +85,7 @@ class StubFilter(ParserTreeFilter):
name_class = StubName name_class = StubName
def _is_name_reachable(self, name): def _is_name_reachable(self, name):
if not super(StubFilter, self)._is_name_reachable(name): if not super()._is_name_reachable(name):
return False return False
# Imports in stub files are only public if they have an "as" # Imports in stub files are only public if they have an "as"

View File

@@ -46,7 +46,7 @@ class TypeVarClass(BaseTypingValue):
class TypeVar(BaseTypingValue): class TypeVar(BaseTypingValue):
def __init__(self, parent_context, tree_name, var_name, unpacked_args): def __init__(self, parent_context, tree_name, var_name, unpacked_args):
super(TypeVar, self).__init__(parent_context, tree_name) super().__init__(parent_context, tree_name)
self._var_name = var_name self._var_name = var_name
self._constraints_lazy_values = [] self._constraints_lazy_values = []
@@ -120,7 +120,7 @@ class TypeVar(BaseTypingValue):
class TypeWrapper(ValueWrapper): class TypeWrapper(ValueWrapper):
def __init__(self, wrapped_value, original_value): def __init__(self, wrapped_value, original_value):
super(TypeWrapper, self).__init__(wrapped_value) super().__init__(wrapped_value)
self._original_value = original_value self._original_value = original_value
def execute_annotation(self): def execute_annotation(self):

View File

@@ -413,7 +413,7 @@ class NewTypeFunction(BaseTypingValue):
class NewType(Value): class NewType(Value):
def __init__(self, inference_state, parent_context, tree_node, type_value_set): def __init__(self, inference_state, parent_context, tree_node, type_value_set):
super(NewType, self).__init__(inference_state, parent_context) super().__init__(inference_state, parent_context)
self._type_value_set = type_value_set self._type_value_set = type_value_set
self.tree_node = tree_node self.tree_node = tree_node

View File

@@ -29,7 +29,7 @@ class LazyKnownValues(AbstractLazyValue):
class LazyUnknownValue(AbstractLazyValue): class LazyUnknownValue(AbstractLazyValue):
def __init__(self, min=1, max=1): def __init__(self, min=1, max=1):
super(LazyUnknownValue, self).__init__(None, min, max) super().__init__(None, min, max)
def infer(self): def infer(self):
return NO_VALUES return NO_VALUES
@@ -37,7 +37,7 @@ class LazyUnknownValue(AbstractLazyValue):
class LazyTreeValue(AbstractLazyValue): class LazyTreeValue(AbstractLazyValue):
def __init__(self, context, node, min=1, max=1): def __init__(self, context, node, min=1, max=1):
super(LazyTreeValue, self).__init__(node, min, max) super().__init__(node, min, max)
self.context = context self.context = context
# We need to save the predefined names. It's an unfortunate side effect # We need to save the predefined names. It's an unfortunate side effect
# that needs to be tracked otherwise results will be wrong. # that needs to be tracked otherwise results will be wrong.

View File

@@ -123,7 +123,7 @@ class AbstractTreeName(AbstractNameDefinition):
else: else:
return None return None
return super(AbstractTreeName, self).get_qualified_names(include_module_names) return super().get_qualified_names(include_module_names)
def _get_qualified_names(self): def _get_qualified_names(self):
parent_names = self.parent_context.get_qualified_names() parent_names = self.parent_context.get_qualified_names()
@@ -242,7 +242,7 @@ class ValueNameMixin(object):
def get_root_context(self): def get_root_context(self):
if self.parent_context is None: # A module if self.parent_context is None: # A module
return self._value.as_context() return self._value.as_context()
return super(ValueNameMixin, self).get_root_context() return super().get_root_context()
def get_defining_qualified_value(self): def get_defining_qualified_value(self):
context = self.parent_context context = self.parent_context
@@ -257,7 +257,7 @@ class ValueNameMixin(object):
class ValueName(ValueNameMixin, AbstractTreeName): class ValueName(ValueNameMixin, AbstractTreeName):
def __init__(self, value, tree_name): def __init__(self, value, tree_name):
super(ValueName, self).__init__(value.parent_context, tree_name) super().__init__(value.parent_context, tree_name)
self._value = value self._value = value
def goto(self): def goto(self):
@@ -429,7 +429,7 @@ class BaseTreeParamName(ParamNameInterface, AbstractTreeName):
class _ActualTreeParamName(BaseTreeParamName): class _ActualTreeParamName(BaseTreeParamName):
def __init__(self, function_value, tree_name): def __init__(self, function_value, tree_name):
super(_ActualTreeParamName, self).__init__( super().__init__(
function_value.get_default_param_context(), tree_name) function_value.get_default_param_context(), tree_name)
self.function_value = function_value self.function_value = function_value
@@ -499,11 +499,11 @@ class _ActualTreeParamName(BaseTreeParamName):
class AnonymousParamName(_ActualTreeParamName): class AnonymousParamName(_ActualTreeParamName):
@plugin_manager.decorate(name='goto_anonymous_param') @plugin_manager.decorate(name='goto_anonymous_param')
def goto(self): def goto(self):
return super(AnonymousParamName, self).goto() return super().goto()
@plugin_manager.decorate(name='infer_anonymous_param') @plugin_manager.decorate(name='infer_anonymous_param')
def infer(self): def infer(self):
values = super(AnonymousParamName, self).infer() values = super().infer()
if values: if values:
return values return values
from jedi.inference.dynamic_params import dynamic_param_lookup from jedi.inference.dynamic_params import dynamic_param_lookup
@@ -527,11 +527,11 @@ class AnonymousParamName(_ActualTreeParamName):
class ParamName(_ActualTreeParamName): class ParamName(_ActualTreeParamName):
def __init__(self, function_value, tree_name, arguments): def __init__(self, function_value, tree_name, arguments):
super(ParamName, self).__init__(function_value, tree_name) super().__init__(function_value, tree_name)
self.arguments = arguments self.arguments = arguments
def infer(self): def infer(self):
values = super(ParamName, self).infer() values = super().infer()
if values: if values:
return values return values
@@ -627,7 +627,7 @@ class StubNameMixin(object):
names = convert_names(names, prefer_stub_to_compiled=False) names = convert_names(names, prefer_stub_to_compiled=False)
if self in names: if self in names:
return super(StubNameMixin, self).py__doc__() return super().py__doc__()
else: else:
# We have signatures ourselves in stubs, so don't use signatures # We have signatures ourselves in stubs, so don't use signatures
# from the implementation. # from the implementation.
@@ -637,7 +637,7 @@ class StubNameMixin(object):
# From here on down we make looking up the sys.version_info fast. # From here on down we make looking up the sys.version_info fast.
class StubName(StubNameMixin, TreeNameDefinition): class StubName(StubNameMixin, TreeNameDefinition):
def infer(self): def infer(self):
inferred = super(StubName, self).infer() inferred = super().infer()
if self.string_name == 'version_info' and self.get_root_context().py__name__() == 'sys': if self.string_name == 'version_info' and self.get_root_context().py__name__() == 'sys':
from jedi.inference.gradual.stub_value import VersionInfo from jedi.inference.gradual.stub_value import VersionInfo
return ValueSet(VersionInfo(c) for c in inferred) return ValueSet(VersionInfo(c) for c in inferred)

View File

@@ -20,7 +20,7 @@ def _add_argument_issue(error_name, lazy_value, message):
class ExecutedParamName(ParamName): class ExecutedParamName(ParamName):
def __init__(self, function_value, arguments, param_node, lazy_value, is_default=False): def __init__(self, function_value, arguments, param_node, lazy_value, is_default=False):
super(ExecutedParamName, self).__init__( super().__init__(
function_value, param_node.name, arguments=arguments) function_value, param_node.name, arguments=arguments)
self._lazy_value = lazy_value self._lazy_value = lazy_value
self._is_default = is_default self._is_default = is_default