From f5695de23d627f9bcc7857cc01dff270edf57f7d Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Fri, 23 Jun 2023 11:28:21 +0300 Subject: [PATCH] visitor: support additional arguments --- src/mdis/visitor.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mdis/visitor.py b/src/mdis/visitor.py index ff26172..d742268 100644 --- a/src/mdis/visitor.py +++ b/src/mdis/visitor.py @@ -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) -- 2.30.2