Re:Glom – Restructured Data for Python
by Too on Thursday May 10, 2018 @12:42AM
(#17036438)
I prefer your nested() version. I don't see why your final example would be ambiguous either, if it always returns a defaulting dict which you always have to extract with .values() there is no ambiguity. This is similar to how Javas Optional<T> work. The problem could be that the type checker isn't good enough and writing code like if nested(target)['system'] == "lazer" could pass the type checker.
[ Parent
| on HN ]
There are no comments on this comment yet.