3 ms·
Yay! I was wishing for this feature just a few days ago. It's somewhat analogous to how sorted (since Python 2.4) frees us from having to tediously make copies
by ptx 7y ago
Yay! I was wishing for this feature just a few days ago. It's somewhat analogous to how sorted (since Python 2.4) frees us from having to tediously make copies of lists to sort them in place.
- gnulinux 7y agoYou can already do {**d1, **d2} today for the same effect.
- CameronNemo 7y agoHere I was wondering what a dictionary union was, already having stumbled upon to it and used it. Note that the method you show is slightly different for cases of dict subclasses. The PEP notes the difference: https://www.python.org/dev/peps/pep-0584/#d1-d2 https://www.python.org/dev/peps/pep-0584/#d1-d2.