README: update naming conventions
authorDmitry Selyutin <ghostmansd@gmail.com>
Tue, 13 Jun 2023 22:40:21 +0000 (01:40 +0300)
committerDmitry Selyutin <ghostmansd@gmail.com>
Tue, 13 Jun 2023 22:40:21 +0000 (01:40 +0300)
README.md

index 9fd6422063b8767d12e9aabaaa97da2955bbbec1..7284b66815fb7185cfad01197cd00f9fa2dec5fb 100644 (file)
--- a/README.md
+++ b/README.md
@@ -26,7 +26,7 @@ The example below shows how to override the way the dicts are traversed so that
 
     class CustomWalker(mdis.walker.Walker):
         @mdis.core.hook(dict)
-        def walk_dict(self, instance):
+        def dispatch_dict(self, instance):
             for (key, value) in instance.items():
                 yield (value, key)
                 yield from self((value, key))
@@ -60,21 +60,21 @@ The example below shows how to execute some arbitrary code upon visiting an obje
     class CustomVisitor(mdis.visitor.Visitor):
         @mdis.core.hook(int)
         @contextlib.contextmanager
-        def visit_int(self, instance):
+        def dispatch_int(self, instance):
             print("entering int")
             yield (instance + 42)
             print("leaving int")
 
         @mdis.core.hook(str)
         @contextlib.contextmanager
-        def visit_str(self, instance):
+        def dispatch_str(self, instance):
             print("entering str")
             yield f"!!!{instance}!!!"
             print("leaving str")
 
         @mdis.core.hook(object)
         @contextlib.contextmanager
-        def visit_object(self, instance):
+        def dispatch_object(self, instance):
             print("entering object")
             yield instance
             print("leaving object")