From: Dmitry Selyutin Date: Wed, 28 Jun 2023 22:11:55 +0000 (+0300) Subject: visitor: simplify default hook X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0364578c804080d24f4e8b656c58c83f9d0abb51;p=mdis.git visitor: simplify default hook --- diff --git a/src/mdis/visitor.py b/src/mdis/visitor.py index bb87fd6..b9c2056 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, *arguments): + def dispatch_object(self, node): return node class ContextVisitor(Visitor): @dispatcher.Hook(object) @contextlib.contextmanager - def dispatch_object(self, node, *arguments): + def dispatch_object(self, node): yield node