visitor: support additional arguments
authorDmitry Selyutin <ghostmansd@gmail.com>
Fri, 23 Jun 2023 08:28:21 +0000 (11:28 +0300)
committerDmitry Selyutin <ghostmansd@gmail.com>
Fri, 23 Jun 2023 08:28:21 +0000 (11:28 +0300)
src/mdis/visitor.py

index ff2617297877fb0fbfab4683e7f95339b8f38c96..d7422681592dfba7d4ba34c40c97dd292e567748 100644 (file)
@@ -15,12 +15,12 @@ class VisitorMeta(dispatcher.DispatcherMeta):
 
 class Visitor(dispatcher.Dispatcher, metaclass=VisitorMeta):
     @dispatcher.Hook(object)
-    def dispatch_object(self, node):
+    def dispatch_object(self, node, *arguments):
         return node
 
 
 class ContextVisitor(Visitor):
     @dispatcher.Hook(object)
     @contextlib.contextmanager
-    def dispatch_object(self, node):
-        yield super().__call__(node)
+    def dispatch_object(self, node, *arguments):
+        yield super().__call__(node, *arguments)