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-94808: Remove unused code in _make_posargs by mjdominus · Pull Request #119227 · python/cpython Conversation
|
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
The current code covers all combinations of plain_names & names_with_default being NULL and non-NULL. Removing one of the cases breaks that, leaving no hint about why this would fall through to the empty // With the current grammar, we never get here. // When that changes, remove the assert, and test thoroughly. assert(0); *posargs = plain_names; |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
I agree, that's better. Should I resubmit? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
4b8f4ac to
4a15e0a
Compare
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
This looks good to me, thanks! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks! I meant to wrap this up over the weekend, but forgot. I will do it this week. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
`names_with_default` is never `NULL`, even if there are no names with defaults. In that case it points to a structure with `size` zero. Rather than eliminating the branch, we leave it behind with an `assert(0)` in case a future change to the grammar exercises the branch.
|
@encukou I split the changes into two commits, one to improve coverage and the other to reorganize the if-else structure. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks! For the future: please avoid force-pushing to CPython -- when reviewed commits disappear, the review needs to be restarted. (In this commit it's not a problem, as it's just a few lines.) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks again for your help and guidance through the whole process. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…GH-119227) * Reorganize four-way if-elsif-elsif-elsif as nested if-elses * Mark unused branch in _make_posargs `names_with_default` is never `NULL`, even if there are no names with defaults. In that case it points to a structure with `size` zero. Rather than eliminating the branch, we leave it behind with an `assert(0)` in case a future change to the grammar exercises the branch.
…GH-119227) * Reorganize four-way if-elsif-elsif-elsif as nested if-elses * Mark unused branch in _make_posargs `names_with_default` is never `NULL`, even if there are no names with defaults. In that case it points to a structure with `size` zero. Rather than eliminating the branch, we leave it behind with an `assert(0)` in case a future change to the grammar exercises the branch.
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.