-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Reduce exception table size by 1 entry for every with-block #409
Comments
PR at python/cpython#93622. |
Maybe I'm missing something, but why is |
It does a decref so I think it can. |
Exceptions in finalizers aren’t propagated. I think a lot of code would be incorrect if |
Hmm. If we can assume that it can’t raise I can make a much smaller PR. |
On the other hand, it’s probably better to have the correct scopes for the try blocks (assuming it can raise, which handler is the right one?). This will help keep the code correct if we change it in the future. |
python/cpython#93622 is merged. Can we close this? |
The dis for this function:
is this:
Note the last row of the exception table: inst 52 goes to 46, same as 38-44. We can reorder the code so that this block is consecutive, and we save one entry in the exception table for each with/async with:
The text was updated successfully, but these errors were encountered: