This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Mark.Shannon
Recipients Mark.Shannon
Date 2020-01-13.12:28:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1578918490.54.0.342025462897.issue39320@roundup.psfhosted.org>
In-reply-to
Content
Currently the unpacking of starred values in arguments and the right hand side of assignments is handled in the interpreter without any help from the compiler.
The layout of arguments and values is visible to the compiler, so the compiler should do more of the work.

We can replace the complex bytecodes used in unpacking with simpler more focused ones.
Specifically the collection building operations 
BUILD_LIST_UNPACK, BUILD_TUPLE_UNPACK, BUILD_SET_UNPACK and BUILD_TUPLE_UNPACK_WITH_CALL
can be replaced with simpler, and self-explanatory operations:
LIST_TO_TUPLE, LIST_EXTEND, SET_UPDATE

In addition, the mapping operations
BUILD_MAP_UNPACK and BUILD_MAP_UNPACK_WITH_CALL
can be replaced with DICT_UPDATE and DICT_MERGE.

DICT_MERGE is like DICT_UPDATE but raises an exception for duplicate keys.

This change would not have much of an effect of performance, as the bytecodes listed are relatively rarely used, but shrinking the interpreter is always beneficial.
History
Date User Action Args
2020-01-13 12:28:10Mark.Shannonsetrecipients: + Mark.Shannon
2020-01-13 12:28:10Mark.Shannonsetmessageid: <1578918490.54.0.342025462897.issue39320@roundup.psfhosted.org>
2020-01-13 12:28:10Mark.Shannonlinkissue39320 messages
2020-01-13 12:28:09Mark.Shannoncreate