Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly handle unpacked assignment for non-constant inside of function #28

Merged
merged 4 commits into from
Aug 2, 2017

Conversation

jpivarski
Copy link
Contributor

Fixes issue #27 .

Old behavior incorrectly created multi-target assignment (Assign(targets=[x, y], value=1)) rather than unpacked assignment (Assign(targets=[Tuple(x, y)], value=Tuple(1, 2))) when the right-hand-side was not a constant inside a function.

  • not a constant: because Python bytecode loads a constant expression as a whole, rather than playing with registers, as it must for a right-hand-side involving symbols
  • inside a function: presumably different (correct) decompiling code handles the not-in-a-function case...

Includes a unit test called test_issue027.

@srossross
Copy link
Owner

Thanks, this looks great.

@srossross srossross merged commit 2b5dc99 into srossross:develop Aug 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants