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 PartlyFluked
Recipients PartlyFluked
Date 2020-12-23.11:21:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1608722479.78.0.847759478082.issue42723@roundup.psfhosted.org>
In-reply-to
Content
Why am I unable to do:

dict = { **sub_dict for sub_dict in super_dict.values() }

which throws: "dict unpacking cannot be used in dict comprehension"

Whereas the equivalent code below doesn't throw any errors?:

dict = {}
for sub_dict in super_dict.values():
    dict = { **dict, **sub_dict }

Am I wrong in thinking the first and second block of code should do the same thing behind the scenes?
History
Date User Action Args
2020-12-23 11:21:19PartlyFlukedsetrecipients: + PartlyFluked
2020-12-23 11:21:19PartlyFlukedsetmessageid: <1608722479.78.0.847759478082.issue42723@roundup.psfhosted.org>
2020-12-23 11:21:19PartlyFlukedlinkissue42723 messages
2020-12-23 11:21:19PartlyFlukedcreate