On Thu, 6 Aug 2020 at 14:57, Jonathan Grant <[email protected]> wrote: > Instead of writing this: > > try: > return my_dict[“a”][“b”][“c”][“d”] > except: > return “some default” > > [...] > > I propose we allow for an inline exception handler, like `eor`: > > return my_dict[“a”][“b”][“c”][“d”] eor “some default”
For this behaviour, you can use the kwkey module: https://pypi.org/project/kwkey/ About PEP 463, the examples in the PEP seem to me less readable. Not sure where the advantage is. _______________________________________________ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/[email protected]/message/4DQHYP5VKMDNXMAQOBWEQ4XC7JJ65GIK/ Code of Conduct: http://python.org/psf/codeofconduct/
