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

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Sat Jun 10 15:32:11 BST 2023


--- Comment #100 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
(In reply to Dmitry Selyutin from comment #94)
> Oh, and by the way, if some weirdo ever wants to override the way the
> default __call__ behaves, they can override __call__ in the derived class.
> Exactly like those visit and generic_visit in AST.

as long as the entire codebase is not full of "isinstance" checks,
worse, "if isinstance elif isinstance elif isinstance" i don't

ohh i get it.

the decorator and especially the defaultdict *does the same job*
as the isinstance(s).

holy cow that's powerful.

btw try this:

        mgr = visitor.registry.get(visitorcls).get(nodecls, None)

visitor.registry = collections.defaultdict(collections.defaultdict)

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

More information about the libre-soc-bugs mailing list