all: fix args and kwargs
authorDmitry Selyutin <ghostmansd@gmail.com>
Sun, 3 Sep 2023 04:24:40 +0000 (07:24 +0300)
committerDmitry Selyutin <ghostmansd@gmail.com>
Sun, 3 Sep 2023 04:24:40 +0000 (07:24 +0300)
src/mdis/dispatcher.py
src/mdis/visitor.py
src/mdis/walker.py

index a80d3af7550e5b0da8dd7a47b1c680b5825afc57..a8794d4d53e7098c412c462c2d8a24102503e52b 100644 (file)
@@ -125,5 +125,5 @@ class Dispatcher(metaclass=DispatcherMeta):
         return hook(self, node, *args, **kwargs)
 
     @Hook(object)
-    def dispatch_object(self, node):
+    def dispatch_object(self, node, *_, **__):
         raise NotImplementedError()
index b9c205687eb5717d272b4057d37579fae6c9f527..3342684137e791765ba2e23b7053256454b6ce43 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, *_, **__):
         return node
 
 
 class ContextVisitor(Visitor):
     @dispatcher.Hook(object)
     @contextlib.contextmanager
-    def dispatch_object(self, node):
+    def dispatch_object(self, node, *_, **__):
         yield node
index ecc9f3b86a04c674e3ce6b04b59762de7b999eeb..b98644a2e987733282fb6f3b6e1d534d3998b684 100644 (file)
@@ -46,28 +46,28 @@ class HashPath(GenericPath):
 
 class Walker(dispatcher.Dispatcher, metaclass=WalkerMeta):
     @dispatcher.Hook(tuple, list)
-    def dispatch_ordered_sequence(self, node):
+    def dispatch_ordered_sequence(self, node, *_, **__):
         for (index, item) in enumerate(node):
             yield (item, node, index, IndexPath)
 
     @dispatcher.Hook(set, frozenset)
-    def dispatch_unordered_sequence(self, node):
+    def dispatch_unordered_sequence(self, node, *_, **__):
         for item in node:
             yield (item, node, item, HashPath)
 
     @dispatcher.Hook(dataclasses.is_dataclass)
-    def dispatch_dataclass(self, node):
+    def dispatch_dataclass(self, node, *_, **__):
         for field in dataclasses.fields(node):
             key = field.name
             value = getattr(node, key)
             yield (value, node, key, AttributePath)
 
     @dispatcher.Hook(dict)
-    def dispatch_mapping(self, node):
+    def dispatch_mapping(self, node, *_, **__):
         for (key, value) in node.items():
             yield (key, node, key, HashPath)
             yield (value, node, key, IndexPath)
 
     @dispatcher.Hook(object)
-    def dispatch_object(self, node):
+    def dispatch_object(self, node, *_, **__):
         yield from ()