From 990ac76a71355e99e87eaee69964edbf6f01ae42 Mon Sep 17 00:00:00 2001 From: Knut Wannheden Date: Thu, 24 Oct 2024 15:54:56 +0200 Subject: [PATCH] Support any type of function call receivers --- rewrite/rewrite/python/_parser_visitor.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/rewrite/rewrite/python/_parser_visitor.py b/rewrite/rewrite/python/_parser_visitor.py index d0b30ede..4676da4a 100644 --- a/rewrite/rewrite/python/_parser_visitor.py +++ b/rewrite/rewrite/python/_parser_visitor.py @@ -1109,12 +1109,10 @@ def visit_Call(self, node): self.__map_type(node.func.value), None ) - elif isinstance(node.func, (ast.Call, ast.Lambda, ast.Subscript)): + else: select = self.__pad_right(cast(Expression, self.__convert(node.func)), self.__whitespace()) # printer handles empty name by not printing `.` before it name = self.__convert_name('') - else: - raise NotImplementedError(f"Calls to functions other than methods are not yet supported: {type(node.func)}") all_args = self.__sort_call_arguments(node) args = JContainer(