mirror of
https://github.com/davidhalter/jedi.git
synced 2026-03-06 14:44:34 +08:00
Make the order of overloaded functions correct
This commit is contained in:
@@ -42,7 +42,7 @@ class ExecutedParamName(ParamName):
|
||||
matches = any(c1.is_sub_class_of(c2)
|
||||
for c1 in argument_values
|
||||
for c2 in annotations.gather_annotation_classes())
|
||||
debug.dbg("signature compare %s: %s <=> %s",
|
||||
debug.dbg("param compare %s: %s <=> %s",
|
||||
matches, argument_values, annotations, color='BLUE')
|
||||
return matches
|
||||
|
||||
|
||||
@@ -55,6 +55,8 @@ class AbstractSignature(_SignatureMixin):
|
||||
raise NotImplementedError
|
||||
|
||||
def __repr__(self):
|
||||
if self.value is self._function_value:
|
||||
return '<%s: %s>' % (self.__class__.__name__, self.value)
|
||||
return '<%s: %s, %s>' % (self.__class__.__name__, self.value, self._function_value)
|
||||
|
||||
|
||||
|
||||
@@ -127,7 +127,8 @@ class FunctionValue(use_metaclass(CachedMetaClass, FunctionMixin, FunctionAndCla
|
||||
if overloaded_funcs:
|
||||
return OverloadedFunctionValue(
|
||||
function,
|
||||
[create(f) for f in overloaded_funcs]
|
||||
# Get them into the correct order: lower line first.
|
||||
list(reversed([create(f) for f in overloaded_funcs]))
|
||||
)
|
||||
return function
|
||||
|
||||
|
||||
Reference in New Issue
Block a user