gh-126835: Move constant unaryop & binop folding to CFG#129550
Conversation
7140ad4 to
a6babab
Compare
February 14, 2025 21:53
|
@iritkatriel CI reports unused functions, but we need them in assertions. So either mark them as used or convert them to macros I guess? |
Sorry, something went wrong.
Put them under |
Sorry, something went wrong.
…nary_expr only on debug builds
|
I've addressed review & simplifed match pattern folding. One question remaining whether we should add tests with hand crafted ast with invalid expressions in match statement case. |
Sorry, something went wrong.
iritkatriel
left a comment
There was a problem hiding this comment.
Looks good!
Sorry, something went wrong.
|
This is looking good. I made some final minor comments. Are you still planning to add tests for invalid hand-crafted ASTs? |
Sorry, something went wrong.
|
Done. Honestly I don't think we need them. We already test folding in match cases quite extensively, and current folding is the same as previous, just for limited expressions. We could add them for completeness, but probably in another PR as this one is getting quite big. But if you think we need them, I could add to this. |
Sorry, something went wrong.
|
Sure. |
Sorry, something went wrong.
|
It would be good to add smoke tests to make sure we don't crash on invalid ast input. Can be in another pr. |
Sorry, something went wrong.
|
!buildbot refleak |
Sorry, something went wrong.
|
🤖 New build scheduled with the buildbot fleet by @iritkatriel for commit cafbc61 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F129550%2Fmerge The command will test the builders whose names match following regular expression: The builders matched are:
|
Sorry, something went wrong.
This PR migrates:
cc @Eclips4 @tomasr8