From e1ad126b7862f7fb74737ca91378552b93eb4cbb Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Sun, 18 Jun 2023 21:36:43 +0300 Subject: [PATCH] walker: eliminate hidden imports --- src/mdis/walker.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/mdis/walker.py b/src/mdis/walker.py index b8fe5ef..5de9ff0 100644 --- a/src/mdis/walker.py +++ b/src/mdis/walker.py @@ -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 () -- 2.30.2