-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[infer/py] preliminary support for
UNPACK_EX
Summary: `UNPACK_EX` is a simple, yet complex operation. It splits a collection (list, tuple, ...) into single variables, with a "left-over" collection. For example it is used to run ``` (x, y, *l, a, b) = range(10) print(x) # 0 print(y) # 1 print(l) = [2, 3, 4, 5, 6, 7] print(a) # 8 print(b) # 9 ``` Since we might not know statically the size of the initial collection, we can't statically do the split, and have to rely on future Pulse magic. We encode it as a builtin which returns a tuple of the right (nr single variables before list + nr single variables after list + 1) number of elements, to be pushed to the stack. Reviewed By: jvillard Differential Revision: D50791204 fbshipit-source-id: a1d13f4dc702873ca3f865c0baaf3256d19af644
- Loading branch information
1 parent
f4bc5cd
commit cf69a47
Showing
2 changed files
with
82 additions
and
8 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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