-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify bytecodes for try-finally, try-except and with blocks. #77568
Comments
The six complex bytecodes currently used for implementing 'with' and 'try' statements can be replaced with just two simpler bytecodes. See https://bugs.python.org/issue32949 for more details of the new bytecodes and how they are used in the 'with' statement. The try-finally statement can be implemented broadly as |
What would be the best way to resolve the discussion between this and bpo-32949? Would it be good to try to get one of them into 3.8? |
Mark merged his PR 6641 but forgot to mention bpo-33387: commit fee5526
|
The new doc seems to use Python version 3.8, but the change was merged into master which is the future Python 3.9, no? .. opcode:: RERAISE
|
Thanks for noticing. |
sweet! =) |
Can this issue be closed now? |
The 3.9 changelog mentions WITH_EXCEPT_FINISH but that seems to have ultimately been called WITH_EXCEPT_START, maybe it shoudl be updated also? |
Yes, thanks for pointing that out. |
I'm reopening this to delete an obsolete comment left behind. |
There's another place that needs to be updated: https://docs.python.org/3/library/dis.html#opcode-SETUP_WITH need to replace WITH_CLEANUP_START by WITH_EXCEPT_START |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: