On Fri, Apr 23, 2021 at 6:25 PM Nathaniel Smith <n...@pobox.com> wrote: > > On Wed, Apr 21, 2021 at 4:50 PM Guido van Rossum <gu...@python.org> wrote: > > On Wed, Apr 21, 2021 at 3:26 PM Nathaniel Smith <n...@pobox.com> wrote: > >> Sure. This was in my list of reasons why the backwards compatibility > >> tradeoffs are forcing us into awkward compromises. I only elaborated > >> on it b/c in your last email you said you didn't understand why this > >> was a problem :-). And except* is definitely useful. But I think there > >> are options for 'except' that haven't been considered fully. > > > > Do you have any suggestions, or are you just telling us to think harder? > > Because we've already thought as hard as we could and within all the > > constraints (backwards compatibility and otherwise) we just couldn't think > > of a better one. > > The main possibility that I don't think we've examined fully is to > make 'except' blocks fire multiple times when there are multiple > exceptions.
Vanilla except blocks? Not sure if I'm misunderstanding, but that could cause some problems. Consider: trn.begin() try: ... except BaseException: trn.rollback() raise else: trn.commit() What happens if multiple exceptions get raised? Will the transaction be rolled back more than once? What gets reraised? If I'm completely misunderstanding you here, my apologies. ChrisA _______________________________________________ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/SGFE3XG4COLBC747U7IBVWRKWAULY43C/ Code of Conduct: http://python.org/psf/codeofconduct/