Terry J. Reedy <tjre...@udel.edu> added the comment:

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.

----------
nosy: +terry.reedy

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue36431>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to