
Feb. 13, 2015
11:34 p.m.
On 13 February 2015 at 05:46, Greg Ewing <greg.ewing@canterbury.ac.nz> wrote:
Eric Snow wrote:
However, the upside to the PEP 448 syntax is that merging could be done without requiring an additional intermediate dict.
It can also detect duplicate keywords and give you a clear error message. The operator would at best give a rather more generic error message and at worst silently discard one of the duplicates.
Since {1: 'a', 1: 'a'} is currently valid, it didn't make much sense to detect duplicates. Unpacking into keywords as f(**d1, **d2) does detect duplicates, however.