Fix signatures for builtin methods

This commit is contained in:
Dave Halter
2019-05-27 20:25:46 +02:00
parent fc4d1151c7
commit 8d24e35fa9
2 changed files with 5 additions and 8 deletions

View File

@@ -403,16 +403,12 @@ class BoundMethod(FunctionMixin, ContextWrapper):
return '<%s: %s>' % (self.__class__.__name__, self._wrapped_context)
class CompiledBoundMethod(compiled.CompiledObject):
def __init__(self, func):
super(CompiledBoundMethod, self).__init__(
func.evaluator, func.access_handle, func.parent_context)
class CompiledBoundMethod(ContextWrapper):
def is_bound_method(self):
return True
def get_param_names(self):
return list(super(CompiledBoundMethod, self).get_param_names())[1:]
def get_signatures(self):
return [sig.bind(self) for sig in self._wrapped_context.get_signatures()]
class SelfName(TreeNameDefinition):

View File

@@ -88,4 +88,5 @@ class BuiltinSignature(AbstractSignature):
return 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)