
This feels a lot like a really verbose way of having nulls-safe operators. On Mon, Mar 2, 2020, 10:40 AM Soni L. <fakedme+py@gmail.com> wrote:
All operations on None should raise a NoneError, which should be a TypeError for backwards compatibility.
try: x = a[b][c][d][e][f] + g.foo(h) except NoneError: x = None
we can then look into merging the proposals of None-aware operators and Exception-aware operators such that the Exception-aware operators fallback to NoneError if no exception type is provided.
we should also look into making "except" default to using NoneError instead of BaseException, with a future flag. _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-leave@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/FJZFLU... Code of Conduct: http://python.org/psf/codeofconduct/