mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-09 23:34:45 +08:00
Fix signatures for builtin methods
This commit is contained in:
@@ -403,16 +403,12 @@ class BoundMethod(FunctionMixin, ContextWrapper):
|
|||||||
return '<%s: %s>' % (self.__class__.__name__, self._wrapped_context)
|
return '<%s: %s>' % (self.__class__.__name__, self._wrapped_context)
|
||||||
|
|
||||||
|
|
||||||
class CompiledBoundMethod(compiled.CompiledObject):
|
class CompiledBoundMethod(ContextWrapper):
|
||||||
def __init__(self, func):
|
|
||||||
super(CompiledBoundMethod, self).__init__(
|
|
||||||
func.evaluator, func.access_handle, func.parent_context)
|
|
||||||
|
|
||||||
def is_bound_method(self):
|
def is_bound_method(self):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def get_param_names(self):
|
def get_signatures(self):
|
||||||
return list(super(CompiledBoundMethod, self).get_param_names())[1:]
|
return [sig.bind(self) for sig in self._wrapped_context.get_signatures()]
|
||||||
|
|
||||||
|
|
||||||
class SelfName(TreeNameDefinition):
|
class SelfName(TreeNameDefinition):
|
||||||
|
|||||||
@@ -88,4 +88,5 @@ class BuiltinSignature(AbstractSignature):
|
|||||||
return self.context
|
return self.context
|
||||||
|
|
||||||
def bind(self, context):
|
def bind(self, context):
|
||||||
raise NotImplementedError('pls implement, need test case, %s' % context)
|
assert not self.is_bound
|
||||||
|
return BuiltinSignature(context, self._return_string, is_bound=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user