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-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/FJZFLUGIGR5DWEYYUZK5LV3ULYNQSGBZ/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to