3 ms·
Ohhh, nice. Also, attrgetter (which also supports dotted notation to get nested attrs! Sadly, no dotted notation for itemgetter.) https://docs.python.org/3/lib
by notpushkin 1y ago
Ohhh, nice. Also, attrgetter (which also supports dotted notation to get nested attrs! Sadly, no dotted notation for itemgetter.)
https://docs.python.org/3/library/operator.html#operator.attrgetter https://docs.python.org/3/library/operator.html#operator.att...
- sischoel 1y agoDotted notation would not work because the keys in a dict can also contain dots. I am not terrible familiar with them but there is something called `lenses` that comes from functional programming that should allow you to access nested structures. And I am pretty sure there must be at least one python library that implements that.