On Fri, Apr 23, 2021 at 6:25 PM Nathaniel Smith <njs@pobox.com> wrote:
On Wed, Apr 21, 2021 at 4:50 PM Guido van Rossum <guido@python.org> wrote:
On Wed, Apr 21, 2021 at 3:26 PM Nathaniel Smith <njs@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