[issue36431] Use dict unpacking for merging two dicts

2019-03-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I hope the low number of such changes has clearly shown that we do not need the plus operator as yet one way of merging two dicts. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed

[issue36431] Use dict unpacking for merging two dicts

2019-03-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset da0847048aa7f934573fa449cea8643def056aa5 by Serhiy Storchaka in branch 'master': bpo-36431: Use PEP 448 dict unpacking for merging two dicts. (GH-12553) https://github.com/python/cpython/commit/da0847048aa7f934573fa449cea8643def056aa5

[issue36431] Use dict unpacking for merging two dicts

2019-03-26 Thread Terry J. Reedy
Terry J. Reedy 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

[issue36431] Use dict unpacking for merging two dicts

2019-03-26 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36431] Use dict unpacking for merging two dicts

2019-03-26 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +12500 stage: -> patch review ___ Python tracker ___ ___

[issue36431] Use dict unpacking for merging two dicts

2019-03-26 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : The following PR replaces the sequence of statement d = d1.copy() d.update(d2) (where d1 and d2 are dicts) with a form proposed in PEP 448: d = {**d1, **d2} or equivalent. Besides functools, where using the new syntax makes the code