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

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Sun Jun 18 20:49:41 BST 2023


--- Comment #170 from Dmitry Selyutin <ghostmansd at gmail.com> ---
(In reply to Jacob Lifshay from comment #169)
> (In reply to Dmitry Selyutin from comment #168)
> > Yielding name along with the value is exactly path tracking. Plus, we
> > iterate over collections, and just values do not really resemble dataclass
> > in the same way just keys or just values don't resemble dict.
> i guess my point is that for dicts you'd sometimes want to recursively walk
> inside the keys too, not just inside values. this is unlike dataclasses,
> namedtuples, standard python classes, etc.

I'd not say so. From perspective of visiting the stuff, for example, printing
the hierarchy, these are not too different to me. If we don't yield key names,
the only other option is to yield something else, e.g. index, which can be
mapped back. And inventing this backward mapping is, well, quite tedious to
handle in all dataclasses. So I don't think that we should drop this path which
is obtained just for granted. My point is, that we should do it for tuples too,
because index is actually a path here.

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

More information about the libre-soc-bugs mailing list