[Libre-soc-bugs] [Bug 1094] insndb instruction database visitor-walker is needed

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Mon Jun 12 21:45:41 BST 2023


https://bugs.libre-soc.org/show_bug.cgi?id=1094

--- Comment #134 from Dmitry Selyutin <ghostmansd at gmail.com> ---
Again, this is a concept. I'm simply tired of all this discussion and needed
some sort of distraction. This concept demonstrates several aspects:

1. The key entity is Dispatcher class. It's used to wrap methods so that the
call is dispatched based on the argument type.
2. Two classes, Visitor and Walker, inherit the Dispatcher (with some magic
involved with metaclasses). Walker describes the way the objects are traversed,
the visitor just enables the context managers.
3. The code supports loose type matches. In the example above, Dict inherits
dict, but is caught loosely by CustomWalker handler for dict.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the libre-soc-bugs mailing list