[mypyc] Match evaluation order of multiple assignment from iterable (#793)#10444
Open
ChetanKhanna wants to merge 4 commits intopython:masterfrom
Open
[mypyc] Match evaluation order of multiple assignment from iterable (#793)#10444ChetanKhanna wants to merge 4 commits intopython:masterfrom
ChetanKhanna wants to merge 4 commits intopython:masterfrom
Conversation
ChetanKhanna
commented
May 8, 2021
| return 1 | ||
|
|
||
| [case testStarUnpack] | ||
| from typing import Any, List, Iterator |
Collaborator
There was a problem hiding this comment.
testMultiAssignmentStarUnpack might be a better name?
JukkaL
reviewed
Nov 12, 2021
| r11 = 'y' | ||
| r12 = PyObject_SetAttr(a, r11, r6) | ||
| r13 = r12 >= 0 :: signed | ||
| r14 = PySequence_List(r3) |
Collaborator
There was a problem hiding this comment.
Hmm should we do this before settings any attributes as well? It seems that we only partially evaluate the values to assign ahead of time if using star unpacking.
…ith Python (python#793) Refactored to iterate rvalues first before performing any assignments. Closes mypyc/mypyc#793.
for more information, see https://pre-commit.ci
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Refactored to iterate rvalues first before performing any assignments to match with Python semantics.
Closes mypyc/mypyc#793.
Test Plan
Added a new test case to test the unpacking with
*xtype lvalues