gh-130080: implement PEP 765#130087
Conversation
There was a problem hiding this comment.
Looks good, but I'm not sure I entirely trust the overwrite/save/overwrite logic.
Saving, overwriting and then overwriting again seems an error prone way to maintain a stack of the current context. ControlFlowInFinallyState can fit in a single byte and the depth of try-finally is limited to 20 (CO_MAXBLOCKS) so a stack will only take 20 bytes or so.
|
When you're done making the requested changes, leave the comment: |
|
I have made the requested changes; please review again. |
tomasr8
left a comment
There was a problem hiding this comment.
I noticed I had some pending comments which I forgot to send.. 😄
Co-authored-by: Tomas R. <[email protected]>
|
I have made the requested changes; please review again. |
|
Thanks for making the requested changes! @markshannon: please review the changes made to this pull request. |
markshannon
left a comment
There was a problem hiding this comment.
There are two unused fields in _PyASTOptimizeState that need removing, otherwise looks good.
Python/ast_opt.c
Outdated
| int ff_features; | ||
| int syntax_check_only; | ||
|
|
||
| int recursion_depth; /* current recursion depth */ |
There was a problem hiding this comment.
This doesn't appear to be used anywhere (same for recursion_limit)
There was a problem hiding this comment.
Thanks. I think they were removed in the const folding PRs after I created this one.
| * :ref:`PEP 741: Python Configuration C API <whatsnew314-pep741>` | ||
| * :ref:`PEP 761: Discontinuation of PGP signatures <whatsnew314-pep761>` | ||
| * :ref:`A new type of interpreter <whatsnew314-tail-call>` | ||
| * :ref:`PEP 765: Disallow return/break/continue that exit a finally block <whatsnew314-pep765>` |
There was a problem hiding this comment.
For the reader, I think it may be better to have the PEP bullet points grouped.
Co-authored-by: Bénédikt Tran <[email protected]>
Co-authored-by: Bénédikt Tran <[email protected]>
…pythonGH-137318) This is required so we would never have empty node bodies. Refs pythonGH-130087 (cherry picked from commit b74f3be) Co-authored-by: sobolevn <[email protected]>
…python#137318) This is required so we would never have empty node bodies. Refs python#130087
Uh oh!
There was an error while loading. Please reload this page.