6 Aug
2020
6 Aug
'20
11:39 a.m.
Hey all, Instead of writing this: ``` try: return my_dict[“a”][“b”][“c”][“d”] except: return “some default” ``` Or this ``` return my_dict.get(“a”, {}).get(“b”, {}),get(“c”, {}).get(“d”, “some default”) ``` I propose we allow for an inline exception handler, like `eor`: ``` return my_dict[“a”][“b”][“c”][“d”] eor “some default” ``` This works very similar to what we already have with `or`, and makes code much more compact and readable. -- Cheers, Jonathan