Add support for except* handling and starred subscripts#6522
Add support for except* handling and starred subscripts#6522
except* handling and starred subscripts#6522Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Comment |
Co-authored-by: youknowone <69878+youknowone@users.noreply.github.com>
except* handling and starred subscripts
There was a problem hiding this comment.
Tests are good. Move it to append to builtin_exceptions.py
|
@copilot try again |
Co-authored-by: youknowone <69878+youknowone@users.noreply.github.com>
|
@copilot CPython doesnt pass |
Co-authored-by: youknowone <69878+youknowone@users.noreply.github.com>
| } else { | ||
| // VISIT(c, expr, e->v.Subscript.slice) | ||
| self.compile_expression(slice)?; | ||
| match slice { |
There was a problem hiding this comment.
I don't see this logic in CPython:
https://github.com/python/cpython/blob/627894459a84be3488a1789919679c997056a03c/Python/compile.c#L6669-L6678
Assuming that this works, I'd like to have a comment explaining why we are deviating from the CPython logic
| @@ -2121,12 +2130,150 @@ impl Compiler { | |||
|
|
|||
| fn compile_try_star_statement( | |||
There was a problem hiding this comment.
| fn compile_try_star_statement( | |
| fn compile_try_star_except( |
| let handler_block = self.new_block(); | ||
| let finally_block = self.new_block(); | ||
|
|
||
| if !finalbody.is_empty() { |
There was a problem hiding this comment.
I'd rather have it split like CPython does it
This makes it easier to maintain when looking for the diff between our impl and theirs
|
@copilot Address change request of @ShaharNaveh |
Co-authored-by: youknowone <69878+youknowone@users.noreply.github.com>
Addressed Shahar’s request by adopting a named constant for the duplicated stack copy in the except* codegen (commit 9b94189). |
|
hmm, probably copilot only reads change request by me |
Oof:/ |
|
not worth to do. I doubt copilot can finish this size one |
|
replaced by #6530 |
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.