Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34k
bpo-45292: [PEP-654] add except*#29581
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
Uh oh!
There was an error while loading. Please reload this page.
Conversation
iritkatriel commented Nov 16, 2021 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
gvanrossum left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Throwaway comment. You may want to ask @pablogsal and/or @lysnikolaou for a review of the parser parts.
Uh oh!
There was an error while loading. Please reload this page.
erlend-aasland left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left some comments about list/tuple API, refcounts, and test coverage in Objects/exceptions.c and Python/ceval.c. I'll save the PEP 7 nitpicks for later ;)
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
iritkatriel commented Nov 17, 2021
The bug is actually related to the exception table lookup. This test fails at the 1/0: with: If I change except* to except it prints:
The except*/except change should not impact the level of the 1/0 instruction. |
gvanrossum commented Nov 17, 2021
@markshannon Can you look at Irit’s last comment? Is it perhaps because the exception table is generated by magic opposes? |
iritkatriel commented Nov 17, 2021
Here is the relevant dis: Old except: Except*: I think it's wrong that an exception from line 90 jumps to line 84. I'm missing something that tells it to go directly to line 100 from there. |
…ssage for mixed except and except*. Add tests for custom errors
iritkatriel commented Nov 19, 2021
@markshannon I think I found the bug - there was a POP_BLOCK that needed to move out of the loop. I'll add a few unit tests and push it. |
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Erlend Egeberg Aasland <[email protected]>
Uh oh!
There was an error while loading. Please reload this page.
…* cases in compiler
This reverts commit ca44878.
gvanrossum left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm assuming Mark and Erlend will handle the remaining review tasks here. I may occasionally take a peek and find something superficial. :-)
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Guido van Rossum <[email protected]>
Uh oh!
There was an error while loading. Please reload this page.
iritkatriel commented Dec 10, 2021
I hope so, but let us know if you are not planning to (@markshannon , @erlend-aasland). @ambv - you also had a close look/experimentation with this PR, any comments from you? |
erlend-aasland left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fantastic job! Here's an "#*%!( lot of nitpicks; feel free to ignore them 🙂 But, more important: I found some branches that weren't covered by the test suite. If possible, we should increase coverage. I also left some comments regarding usage of some C API's.
Nitpicks come in two flavours:
- PEP 7 nitpicks. (I started applying PEP 7 comments to
Python/compile.cas well, but I guess it's ok to disregard PEP 7 for that file.) - Minor C API nitpicks (mostly use
Py_Is,Py_IsNone, etc.). Do with these comments as you want 🗑️
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Thank you Erlend! Co-authored-by: Erlend Egeberg Aasland <[email protected]>
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Erlend Egeberg Aasland <[email protected]>
…l/cpython into bpo-45292-except_star
gvanrossum left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merge whenever you feel ready!
markshannon commented Dec 14, 2021
I don't think that this was ready to merge. As I said before, this does too much in the interpreter that should be done in the compiler. |
gvanrossum commented Dec 14, 2021
Sorry if we jumped the gun. But this works well enough so that we can start writing code that uses it (which is a requirement the SC gave us when they approved PEP 654). I suppose we could do that in a branch, but that's very awkward -- it places a high barrier on those who just want to experiment with what this feels like. There will be plenty of opportunity to refactor the implementation -- we have many alpha releases left until beta 1 (late May), and even after that we can fix bugs until the release candidates start (in August). |
iritkatriel commented Dec 14, 2021
@ambv has been doing it in a branch and did not report any bugs so far. We need more people to start using it, we need feedback on both the semantics and the implementation, and we need to give @1st1 time to develop the asyncio parts. Indeed, I am keen to hear @markshannon's ideas about refactoring/simplifying/optimizing the implementation. The first suggestion (2-3 weeks ago) didn't work because it overlooked that fact that we need to maintain state between the except* clauses. Hopefully we can find something that does work. |
gvanrossum commented Dec 14, 2021 • edited by bedevere-bot
Loading Uh oh!
There was an error while loading. Please reload this page.
edited by bedevere-bot
Uh oh!
There was an error while loading. Please reload this page.
Let's move that discussion back to bpo-45292. |
markshannon commented Dec 14, 2021
Unfortunately, this change results in a 1% slowdown |
Uh oh!
There was an error while loading. Please reload this page.
https://bugs.python.org/issue45292