From 07bde0f4377dd1bd6067cc7c3e6f29b9b9d508b4 Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Sun, 18 Jun 2023 21:36:36 +0300 Subject: [PATCH] visitor: eliminate hidden imports --- src/mdis/visitor.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/mdis/visitor.py b/src/mdis/visitor.py index 8eb1f22..ca6f809 100644 --- a/src/mdis/visitor.py +++ b/src/mdis/visitor.py @@ -1,20 +1,26 @@ -import contextlib as _contextlib +__all__ = [ + "ContextVisitor", + "Visitor", + "VisitorMeta", +] -from . import dispatcher as _dispatcher +import contextlib +from . import dispatcher -class VisitorMeta(_dispatcher.DispatcherMeta): + +class VisitorMeta(dispatcher.DispatcherMeta): pass -class Visitor(_dispatcher.Dispatcher, metaclass=VisitorMeta): - @_dispatcher.Hook(object) +class Visitor(dispatcher.Dispatcher, metaclass=VisitorMeta): + @dispatcher.Hook(object) def dispatch_object(self, instance): return instance class ContextVisitor(Visitor): - @_dispatcher.Hook(object) - @_contextlib.contextmanager + @dispatcher.Hook(object) + @contextlib.contextmanager def dispatch_object(self, instance): yield super().__call__(instance=instance) -- 2.30.2