On Thu, 6 Aug 2020 at 14:57, Jonathan Grant <jonathanallengr...@gmail.com> 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 -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/4DQHYP5VKMDNXMAQOBWEQ4XC7JJ65GIK/ Code of Conduct: http://python.org/psf/codeofconduct/