walker: eliminate hidden imports
authorDmitry Selyutin <ghostmansd@gmail.com>
Sun, 18 Jun 2023 18:36:43 +0000 (21:36 +0300)
committerDmitry Selyutin <ghostmansd@gmail.com>
Sun, 18 Jun 2023 18:42:08 +0000 (21:42 +0300)
src/mdis/walker.py

index b8fe5eff76ea1ea4375e3025f51f25f168962576..5de9ff0e6055487802fe2b464ad020461d52b0c4 100644 (file)
@@ -1,23 +1,28 @@
-from . import dispatcher as _dispatcher
+__all__ = [
+    "Walker",
+    "WalkerMeta",
+]
 
+from . import dispatcher
 
-class WalkerMeta(_dispatcher.DispatcherMeta):
+
+class WalkerMeta(dispatcher.DispatcherMeta):
     pass
 
 
-class Walker(_dispatcher.Dispatcher, metaclass=WalkerMeta):
-    @_dispatcher.Hook(tuple, list, set, frozenset)
+class Walker(dispatcher.Dispatcher, metaclass=WalkerMeta):
+    @dispatcher.Hook(tuple, list, set, frozenset)
     def dispatch_sequence(self, instance):
         for item in instance:
             yield item
             yield from self(item)
 
-    @_dispatcher.Hook(dict)
+    @dispatcher.Hook(dict)
     def dispatch_mapping(self, instance):
         for (key, value) in instance.items():
             yield (key, value)
             yield from self((key, value))
 
-    @_dispatcher.Hook(object)
+    @dispatcher.Hook(object)
     def dispatch_object(self, instance):
         yield from ()