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 terry.reedy
Recipients rhettinger, serhiy.storchaka, terry.reedy
Date 2019-03-27.00:16:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1553645773.76.0.568810849183.issue36431@roundup.psfhosted.org>
In-reply-to
Content
3 years ago, Trey Hunter found 11 ways to merge to a new dict.
https://treyhunner.com/2016/02/how-to-merge-dictionaries-in-python/
He followed up with a performance comparison.
https://gist.github.com/treyhunner/f35292e676efa0be1728
** unpacking was nearly twice as fast as the 2nd place methods.
(Bigger dict might change the ratio, but I expect ** unpacking to remain first.)

Trey's summary: "This is simple and Pythonic. There are quite a few symbols, but it’s fairly clear that the output is a dictionary at least."  I consider the last point a major plus.

User comment: "Beautiful. Pythonic. Thank you."  No negatives.
History
Date User Action Args
2019-03-27 00:16:13terry.reedysetrecipients: + terry.reedy, rhettinger, serhiy.storchaka
2019-03-27 00:16:13terry.reedysetmessageid: <1553645773.76.0.568810849183.issue36431@roundup.psfhosted.org>
2019-03-27 00:16:13terry.reedylinkissue36431 messages
2019-03-27 00:16:13terry.reedycreate