bpo-39320: Handle unpacking of *values in compiler (GH-17984)

* Add three new bytecodes: LIST_TO_TUPLE, LIST_EXTEND, SET_UPDATE. Use them to implement star unpacking expressions.

* Remove four bytecodes BUILD_LIST_UNPACK, BUILD_TUPLE_UNPACK, BUILD_SET_UNPACK and  BUILD_TUPLE_UNPACK_WITH_CALL opcodes as they are now unused.

* Update magic number and dis.rst for new bytecodes.
This commit is contained in:
Mark Shannon 2020-01-23 09:25:17 +00:00 committed by GitHub
parent f9e07e116c
commit 13bc13960c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 2349 additions and 2360 deletions

View file

@ -252,12 +252,12 @@ What about willful misconduct?
>>> h(1, *h)
Traceback (most recent call last):
...
TypeError: test.test_extcall.h() argument after * must be an iterable, not function
TypeError: Value after * must be an iterable, not function
>>> h(*[1], *h)
Traceback (most recent call last):
...
TypeError: test.test_extcall.h() argument after * must be an iterable, not function
TypeError: Value after * must be an iterable, not function
>>> dir(*h)
Traceback (most recent call last):