GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||
GeezerVison is showing github.com — gh-98831: add variable stack effect support to cases generator by iritkatriel · Pull Request #101309 · python/cpython Conversation
|
|
We’ll want something more efficient than this. Maybe generate a function with a switch statement for each value? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Yes. Read this after writing my response. :-) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Very nice, just one request and one suggestion.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| self.out.emit(f" case {instr.name}:") | ||
| self.out.emit(f" return {effect};") | ||
| self.out.emit(" default:") | ||
| self.out.emit(" Py_UNREACHABLE();") |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
If you make this return -1; then you can drop all the cases that return -1, making the function much shorter.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
There won't be any -1's when we finish. We could group all cases with the same value if we want.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Ah, makes sense. LGTM then.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.