- ...
- We can already easily get the same functionality using standard Python. E.g., instead of doing foo?["bar"]?[0]?["baz"], we could do lookup(foo, "bar", 0, "baz") where lookup is a function that looks roughly like this:
def lookup(item, *parts):
for part in parts:
if item is None:
return None
item = item[parts]
return item