Dictionary access
Is there some way to do dictionary access other than iteration over KeyValuePair objects? It is a little verbose:
foo[self.key == "bar"]/value/baz
I recently forked the project and added a little patch which checks whether dictionaries have a key matching the current attribute so I can instead do things like:
foo/bar/baz
Which is pretty nice. In this patch though, if foo doesn't have a bar key, then it will iterate the dictionary as normal, and try to find bar on KeyValuePair objects. It would be nice if there was some explicit way to denote that you want to specifically traverse dictionaries by key-name, rather than as an iterator.
Another way I have experimented with getting this to work is by using AttrDict. However, this doesn't work out of the box since the check whether a value is an iterator is done first so AttrDicts are treated as normal dicts and you get KeyValuePair objects.
What about something like:
foo:/bar/baz
where :/ denotes a getitem access?
Curious to know your thoughts.
I don't support this library. If you have a specific PR though I might be willing to merge it.